diff options
author | Martin Sebor <msebor@redhat.com> | 2018-02-09 17:58:54 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2018-02-09 10:58:54 -0700 |
commit | cea71f0a97520aeeba6509688047311a75f35421 (patch) | |
tree | 8bfff2558f9a41d6c8acc91bd7eff469ccae8b1b | |
parent | cad5b07905fb24447dced464b6f60b70178f2fea (diff) | |
download | gcc-cea71f0a97520aeeba6509688047311a75f35421.zip gcc-cea71f0a97520aeeba6509688047311a75f35421.tar.gz gcc-cea71f0a97520aeeba6509688047311a75f35421.tar.bz2 |
PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
gcc/c-family/ChangeLog:
PR lto/84212
* c.opt (-Wstringop-overflow, -Warray-bounds): Add LTO.
(-Walloc-size-larger-than, -Wformat-truncation=): Same.
(-Wmaybe-uninitialized, -Wnonnull, -Wrestrict): Same.
(-Wstrict-overflow, -Wsuggest-attribute): Same.
(-Wuninitialized): Same.
gcc/testsuite/ChangeLog:
PR lto/84212
* gcc.dg/lto/pr84212_0.c: New test file.
* gcc.dg/lto/pr84212_1.c: Same.
From-SVN: r257534
-rw-r--r-- | gcc/c-family/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/c-family/c.opt | 24 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr84212_0.c | 11 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr84212_1.c | 11 |
5 files changed, 49 insertions, 12 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 881df2c..2378181 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,12 @@ +2018-02-09 Martin Sebor <msebor@redhat.com> + + PR lto/84212 + * c.opt (-Wstringop-overflow, -Warray-bounds): Add LTO. + (-Walloc-size-larger-than, -Wformat-truncation=): Same. + (-Wmaybe-uninitialized, -Wnonnull, -Wrestrict): Same. + (-Wstrict-overflow, -Wsuggest-attribute): Same. + (-Wuninitialized): Same. + 2018-02-09 Eric Botcazou <ebotcazou@adacore.com> * c-ada-spec.c (dump_ada_declaration): Do not generate the 'constant' diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 9c71726..7fb386d 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -304,7 +304,7 @@ C ObjC C++ ObjC++ Var(warn_alloca) Warning Warn on any use of alloca. Walloc-size-larger-than= -C ObjC C++ ObjC++ Var(warn_alloc_size_limit) Warning Joined LangEnabledBy(C ObjC C++ ObjC++,Wall) +C ObjC C++ LTO ObjC++ Var(warn_alloc_size_limit) Warning Joined LangEnabledBy(C ObjC C++ LTO ObjC++,Wall) -Walloc-size-larger-than=<bytes> Warn for calls to allocation functions that attempt to allocate objects larger than the specified number of bytes. @@ -319,11 +319,11 @@ alloca, and on bounded uses of alloca whose bound can be larger than <number> bytes. Warray-bounds -LangEnabledBy(C ObjC C++ ObjC++,Wall) +LangEnabledBy(C ObjC C++ LTO ObjC++,Wall) ; in common.opt Warray-bounds= -LangEnabledBy(C ObjC C++ ObjC++,Wall,1,0) +LangEnabledBy(C ObjC C++ LTO ObjC++,Wall,1,0) ; in common.opt Wassign-intercept @@ -575,12 +575,12 @@ C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEn Warn about printf/scanf/strftime/strfmon format string anomalies. Wformat-overflow= -C ObjC C++ LTO ObjC++ Joined RejectNegative UInteger Var(warn_format_overflow) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 1, 0) IntegerRange(0, 2) +C ObjC C++ LTO ObjC++ Joined RejectNegative UInteger Var(warn_format_overflow) Warning LangEnabledBy(C ObjC C++ LTO ObjC++,Wformat=, warn_format >= 1, 0) IntegerRange(0, 2) Warn about function calls with format strings that write past the end of the destination region. Wformat-truncation= -C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format_trunc) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 1, 0) IntegerRange(0, 2) +C ObjC C++ LTO ObjC++ Joined RejectNegative UInteger Var(warn_format_trunc) Warning LangEnabledBy(C ObjC C++ LTO ObjC++,Wformat=, warn_format >= 1, 0) IntegerRange(0, 2) Warn about calls to snprintf and similar functions that truncate output. Wif-not-aligned @@ -739,17 +739,17 @@ C ObjC C++ ObjC++ Var(warn_sizeof_array_argument) Warning Init(1) Warn when sizeof is applied on a parameter declared as an array. Wstringop-overflow -C ObjC C++ ObjC++ Warning Alias(Wstringop-overflow=, 2, 0) +C ObjC C++ LTO ObjC++ Warning Alias(Wstringop-overflow=, 2, 0) Warn about buffer overflow in string manipulation functions like memcpy and strcpy. Wstringop-overflow= -C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_stringop_overflow) Init(2) Warning LangEnabledBy(C ObjC C++ ObjC++, Wall, 2, 0) IntegerRange(0, 4) +C ObjC C++ LTO ObjC++ Joined RejectNegative UInteger Var(warn_stringop_overflow) Init(2) Warning LangEnabledBy(C ObjC C++ LTO ObjC++, Wall, 2, 0) IntegerRange(0, 4) Under the control of Object Size type, warn about buffer overflow in string manipulation functions like memcpy and strcpy. Wstringop-truncation -C ObjC C++ ObjC++ Var(warn_stringop_truncation) Warning Init (1) LangEnabledBy(C ObjC C++ ObjC++, Wall) +C ObjC C++ LTO ObjC++ Var(warn_stringop_truncation) Warning Init (1) LangEnabledBy(C ObjC C++ LTO ObjC++, Wall) Warn about truncation in string manipulation functions like strncat and strncpy. Wsuggest-attribute=format @@ -833,11 +833,11 @@ C++ ObjC++ Var(warn_nonvdtor) Warning LangEnabledBy(C++ ObjC++,Weffc++) Warn about non-virtual destructors. Wnonnull -C ObjC C++ ObjC++ Var(warn_nonnull) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=,warn_format >= 1,0) +C ObjC C++ LTO ObjC++ Var(warn_nonnull) Warning LangEnabledBy(C ObjC C++ LTO ObjC++,Wformat=,warn_format >= 1,0) Warn about NULL being passed to argument slots marked as requiring non-NULL. Wnonnull -C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall) +C ObjC C++ LTO ObjC++ LangEnabledBy(C ObjC C++ LTO ObjC++,Wall) ; Wnonnull-compare @@ -1084,11 +1084,11 @@ C ObjC C++ ObjC++ CPP(warn_undef) CppReason(CPP_W_UNDEF) Var(cpp_warn_undef) Ini Warn if an undefined macro is used in an #if directive. Wuninitialized -C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall) +C ObjC C++ ObjC++ LTO LangEnabledBy(C ObjC C++ ObjC++ LTO,Wall) ; Wmaybe-uninitialized -C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall) +C ObjC C++ ObjC++ LTO LangEnabledBy(C ObjC C++ ObjC++ LTO,Wall) ; Wunknown-pragmas diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f381e22..c303895 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-02-09 Martin Sebor <msebor@redhat.com> + + PR lto/84212 + * gcc.dg/lto/pr84212_0.c: New test file. + * gcc.dg/lto/pr84212_1.c: Same. + 2018-02-09 Peter Bergner <bergner@vnet.ibm.com> PR target/83926 diff --git a/gcc/testsuite/gcc.dg/lto/pr84212_0.c b/gcc/testsuite/gcc.dg/lto/pr84212_0.c new file mode 100644 index 0000000..859b2fa --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr84212_0.c @@ -0,0 +1,11 @@ +/* PR lto/84212 - -Wno-stringop-verflow does not disable warnings from + -flto link stage + { dg-lto-do link } + { dg-lto-options { { -O2 -Werror -Wno-stringop-overflow -flto } } } */ + +#include <string.h> + +void clear (char *p, unsigned n) +{ + memset (p, 0, n); +} diff --git a/gcc/testsuite/gcc.dg/lto/pr84212_1.c b/gcc/testsuite/gcc.dg/lto/pr84212_1.c new file mode 100644 index 0000000..7ad8a7d --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr84212_1.c @@ -0,0 +1,11 @@ +/* PR lto/84212 - -Wno-stringop-verflow does not disable warnings from + -flto link stage */ + +extern void clear (char*, unsigned); + +int main (void) +{ + char x[3]; + + clear (x, 4); +} |