Re: [PATCH 1/2] build: suppress warnings to add pure or const attributes
From:
Collin Funk
Subject:
Re: [PATCH 1/2] build: suppress warnings to add pure or const attributes
Date:
Mon, 17 Aug 2026 21:13:19 -0700
User-agent:
Gnus/5.13 (Gnus v5.13)
PƔdraig Brady <P@draigBrady.com> 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