From: Jonathan Wakely Date: Thu, 19 Mar 2020 15:33:02 +0000 (+0000) Subject: doc: Note that some warnings depend on optimizations (PR 92757) X-Git-Tag: embedded-9-2020q2~83 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=337111a23499e597707f220662b2567e3f3bd6ea;p=thirdparty%2Fgcc.git doc: Note that some warnings depend on optimizations (PR 92757) Backport from mainline 2020-01-13 Jonathan Wakely PR driver/92757 * doc/invoke.texi (Warning Options): Add caveat about some warnings depending on optimization settings. --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 90a5cf5c8d82..91bcc48cecab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2020-03-19 Jonathan Wakely + + Backport from mainline + 2020-01-13 Jonathan Wakely + + PR driver/92757 + * doc/invoke.texi (Warning Options): Add caveat about some warnings + depending on optimization settings. + 2020-03-19 Jiufu Guo PR target/93709 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 0ab6c9c64494..0f6247caf515 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -4313,6 +4313,11 @@ are being produced. This allows the use of new @option{-Wno-} options with old compilers, but if something goes wrong, the compiler warns that an unrecognized option is present. +The effectiveness of some warnings depends on optimizations also being +enabled. For example @option{-Wsuggest-final-types} is more effective +with link-time optimization and @option{-Wmaybe-uninitialized} will not +warn at all unless optimization is enabled. + @table @gcctabopt @item -Wpedantic @itemx -pedantic