https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115237
Pádraig Brady <P at draigBrady dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |P at draigBrady dot com
--- Comment #3 from Pádraig Brady <P at draigBrady dot com> ---
Note we just fixed a bug in gnulib for a function that was incorrectly marked
as pure because GCC was incorrectly suggesting this.
IMHO GCC should only be making such attribute suggestions when it is _100%
sure_ it's appropriate.
In this particular case it's 0% appropriate as the function may not return.
Also this was a static function which is discussed in bug #109914
The particular issue we saw was with `clang -O1 -fno-inline`.
In that case the function was identified as returning its input unchanged,
but when not inlined the error() call was not seen and therefore
clang honored the "pure" attribute and eliminated the function.
That was with clang 21 and 22 at least.
The fix pushed to suppress the warning, while still producing correct code was:
https://github.com/coreutils/gnulib/commit/e9732ba14a