From aef85e40e0c5e242f1a1883abc56159dcd90e7b0 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 2 Dec 2019 21:32:54 +0000 Subject: [PATCH] doc: Note that some warnings depend on optimizations (PR 92757) PR driver/92757 * doc/invoke.texi (Warning Options): Add caveat about some warnings depending on optimization settings. --- gcc/ChangeLog | 6 ++++++ gcc/doc/invoke.texi | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f7df07343d1..b2d12f4ccb9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2020-01-13 Jonathan Wakely + + PR driver/92757 + * doc/invoke.texi (Warning Options): Add caveat about some warnings + depending on optimization settings. + 2020-01-13 Jakub Jelinek PR tree-optimization/90838 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index f2c805c0a64..ab307b8e53a 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -4575,6 +4575,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 -- 2.30.2