Pádraig Brady <[email protected]> writes:

> The particular trigger for disabling this now was
> changing copy_debug_string() from using unreachable()
> to assert() will incorrectly induce gcc 16.1 to suggest
> adding __attribute(pure) even though this static function
> may have side effects like aborting the program.
> Note given the current use of copy_debug_string(),
> that would likely be OK to allow common subexpression elimination,
> however "pure" also allows for calls to be removed entirely
> depending on usage of the function (as noted in the bug url below).
> Therefore it's safer to avoid all this until at least
> the compiler bug below is addressed.
>
> * configure.ac: Remove -Wsuggest-attribute={pure,const}.
> These are currently innacurate and dangerous.
> See https://gcc.gnu.org/PR115237
> ---
>  configure.ac | 6 ++++++
>  1 file changed, 6 insertions(+)

Ouch, I remember that one.

Looks good to me. One can occasionally enable them manually if they want
to see if there are any correct warnings, keeping in mind those
dangerous cases.

Collin

Reply via email to