diff options
author | Joseph Myers <joseph@codesourcery.com> | 2010-08-30 11:30:57 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2010-08-30 11:30:57 +0100 |
commit | 184eb658fe5d4897c705d28ad01c3bd51e8fc62f (patch) | |
tree | 2d9eb313ce47a3ac9f0c2ace6d148777d7029209 /gcc | |
parent | 9552aca7868b62ed1fa3532a4bdad93f8dc00f54 (diff) | |
download | gcc-184eb658fe5d4897c705d28ad01c3bd51e8fc62f.zip gcc-184eb658fe5d4897c705d28ad01c3bd51e8fc62f.tar.gz gcc-184eb658fe5d4897c705d28ad01c3bd51e8fc62f.tar.bz2 |
opts.h (CL_ERR_NEGATIVE): Define.
* opts.h (CL_ERR_NEGATIVE): Define.
* opts.c (unknown_option_callback): Don't postpone warnings for
options marked with CL_ERR_NEGATIVE.
* opts-common.c (decode_cmdline_option): Set CL_ERR_NEGATIVE error
for negative versions of CL_REJECT_NEGATIVE options.
testsuite:
* gcc.dg/opts-1.c: Expect errors, not warnings.
From-SVN: r163637
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/opts-common.c | 1 | ||||
-rw-r--r-- | gcc/opts.c | 3 | ||||
-rw-r--r-- | gcc/opts.h | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/opts-1.c | 4 |
6 files changed, 20 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5a23b03..37106bf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2010-08-30 Joseph Myers <joseph@codesourcery.com> + + * opts.h (CL_ERR_NEGATIVE): Define. + * opts.c (unknown_option_callback): Don't postpone warnings for + options marked with CL_ERR_NEGATIVE. + * opts-common.c (decode_cmdline_option): Set CL_ERR_NEGATIVE error + for negative versions of CL_REJECT_NEGATIVE options. + 2010-08-30 Uros Bizjak <ubizjak@gmail.com> * config/i386/i386.md (zero_extendsidi2_1): Rename from diff --git a/gcc/opts-common.c b/gcc/opts-common.c index cd4ec2b..871e466 100644 --- a/gcc/opts-common.c +++ b/gcc/opts-common.c @@ -197,6 +197,7 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask, if (!value && (option->flags & CL_REJECT_NEGATIVE)) { opt_index = OPT_SPECIAL_unknown; + errors |= CL_ERR_NEGATIVE; arg = argv[0]; goto done; } @@ -482,7 +482,8 @@ unknown_option_callback (const struct cl_decoded_option *decoded) { const char *opt = decoded->arg; - if (opt[1] == 'W' && opt[2] == 'n' && opt[3] == 'o' && opt[4] == '-') + if (opt[1] == 'W' && opt[2] == 'n' && opt[3] == 'o' && opt[4] == '-' + && !(decoded->errors & CL_ERR_NEGATIVE)) { /* We don't generate warnings for unknown -Wno-* options unless we issue diagnostics. */ @@ -102,6 +102,9 @@ extern const unsigned int cl_lang_count; #define CL_ERR_MISSING_ARG (1 << 1) /* Argument required but missing. */ #define CL_ERR_WRONG_LANG (1 << 2) /* Option for wrong language. */ #define CL_ERR_UINT_ARG (1 << 3) /* Bad unsigned integer argument. */ +#define CL_ERR_NEGATIVE (1 << 4) /* Negative form of option + not permitted (together + with OPT_SPECIAL_unknown). */ /* Structure describing the result of decoding an option. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fe9f024..984c2f4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2010-08-30 Joseph Myers <joseph@codesourcery.com> + + * gcc.dg/opts-1.c: Expect errors, not warnings. + 2010-08-29 Janus Weil <janus@gcc.gnu.org> PR fortran/42769 diff --git a/gcc/testsuite/gcc.dg/opts-1.c b/gcc/testsuite/gcc.dg/opts-1.c index 0d16c3d..3b90fe9 100644 --- a/gcc/testsuite/gcc.dg/opts-1.c +++ b/gcc/testsuite/gcc.dg/opts-1.c @@ -5,5 +5,5 @@ /* { dg-error "-fno-abi-version" "-fno-abi-version" { target *-*-* } 0 } */ /* { dg-error "-fno-lto-compression-level" "-fno-lto-compression-level" { target *-*-* } 0 } */ /* { dg-error "-fno-tree-parallelize-loops" "-fno-tree-parallelize-loops" { target *-*-* } 0 } */ -/* { dg-warning "-Wno-strict-overflow" "-Wno-strict-overflow" { target *-*-* } 0 } */ -/* { dg-warning "-Wno-strict-aliasing" "-Wno-strict-aliasing" { target *-*-* } 0 } */ +/* { dg-error "-Wno-strict-overflow" "-Wno-strict-overflow" { target *-*-* } 0 } */ +/* { dg-error "-Wno-strict-aliasing" "-Wno-strict-aliasing" { target *-*-* } 0 } */ |