diff options
author | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-16 15:31:46 +0000 |
---|---|---|
committer | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-16 15:31:46 +0000 |
commit | 77b27208e4842b5adb8d007d52ca6bbaa03f0e6d (patch) | |
tree | 4ce566a273abe5c8b53f22c6bfb4b3a8226b26e0 /gcc/testsuite/gcc.dg | |
parent | b2a4240a1c8eeb25325a5ba4a8dd68f5406bff6b (diff) | |
download | gcc-77b27208e4842b5adb8d007d52ca6bbaa03f0e6d.tar.gz |
2012-10-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/53063
PR c/40989
gcc/
* optc-gen.awk: Handle new form of LangEnabledBy.
* opts.c (set_Wstrict_aliasing): Declare here. Make static.
* common.opt (Wstrict-aliasing=,Wstrict-overflow=): Do not use Init.
* doc/options.texi (LangEnabledBy): Document new form.
* flags.h (set_Wstrict_aliasing): Do not declare.
c-family/
* c.opt (Wstrict-aliasing=,Wstrict-overflow=): Use LangEnabledBy.
* c-opts.c (c_common_handle_option): Do not set them here. Add
comment.
(c_common_post_options): Likewise.
testsuite/
* gcc.dg/Wstrict-overflow-24.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192502 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/Wstrict-overflow-24.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wstrict-overflow-24.c b/gcc/testsuite/gcc.dg/Wstrict-overflow-24.c new file mode 100644 index 00000000000..05e8dd14484 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wstrict-overflow-24.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-fstrict-overflow -O2" } */ +/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */ +#pragma GCC diagnostic error "-Wstrict-overflow" + +int +foo (int i) +{ + return __builtin_abs (i) >= 0; /* { dg-error "assuming signed overflow does not occur" "correct warning" } */ +} |