https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108646

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonny Grant from comment #3)
> Is it worth -Wnonnull emitting a warning message that it needs optimization
> to get the needed data flow analysis?

No, there are dozens of warnings that work poorly, or not at all, unless
optimization is enabled. It's in the manual.

"The effectiveness of some warnings depends on optimizations also being
enabled. For example -Wsuggest-final-types is more effective with link-time
optimization and some instances of other warnings may not be issued at all
unless optimization is enabled. While optimization in general improves the
efficacy of control and data flow sensitive warnings, in some cases it may also
cause false positives."

Reply via email to