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