Bad interaction between gcc and glibc's handling of GNU <error.h> extension [GCC PR 115724]
Mark Wielaard
mark@klomp.org
Tue Jul 2 20:39:50 GMT 2024
Hi David,
On Tue, Jul 02, 2024 at 03:57:58PM -0400, David Malcolm wrote:
> > > At -O0 sure, that is how __builtin_constant_p works.
> > > The above is intended for optimized compilation, and I think it
> > > works just fine then.
> >
> > And it's generally needed with optimization only, to suppress
> > warnings
> > in unreachable code that only happen when optimization is turned on.
>
> Indeed - and that's why -fanalyzer ran into it at -O0.
Various -fanalyzer sub-options say something like "optimization should
be disabled when attempting to trigger this diagnostic".
Is there an "optimal" optimization level for -fanalyzer (like having
-Og for debugging)?
Thanks,
Mark
More information about the Libc-alpha
mailing list