diff options
author | Brendan Kehoe <brendan@gcc.gnu.org> | 1993-01-14 19:35:00 -0500 |
---|---|---|
committer | Brendan Kehoe <brendan@gcc.gnu.org> | 1993-01-14 19:35:00 -0500 |
commit | a2468e45b484872253f5be220700d09cab6f29d7 (patch) | |
tree | 640ae11fef51482da5e8d4f30286d469c551f3ce | |
parent | 48fb792a91a6b0850d723dc87bcc18eeab7ac3f5 (diff) | |
download | gcc-a2468e45b484872253f5be220700d09cab6f29d7.zip gcc-a2468e45b484872253f5be220700d09cab6f29d7.tar.gz gcc-a2468e45b484872253f5be220700d09cab6f29d7.tar.bz2 |
c-decl.c (c_decode_option): Set WARN_UNINITIALIZED to 2 with -Wall...
* c-decl.c (c_decode_option): Set WARN_UNINITIALIZED to 2 with
-Wall, being careful to preserve it if it's already set.
* cp-decl2.c (lang_decode_option): Likewise.
* toplev.c (main): Warn about using -Wuninitialized without -O.
From-SVN: r3250
-rw-r--r-- | gcc/c-decl.c | 6 | ||||
-rw-r--r-- | gcc/toplev.c | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 74c5ca1..3222fd0 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -650,7 +650,11 @@ c_decode_option (p) else if (!strcmp (p, "-Wall")) { extra_warnings = 1; - warn_uninitialized = 1; + /* We save the value of warn_uninitialized, since if they put + -Wuninitialized on the command line, we need to generate a + warning about not using it without also specifying -O. */ + if (warn_uninitialized != 1) + warn_uninitialized = 2; warn_implicit = 1; warn_return_type = 1; warn_unused = 1; diff --git a/gcc/toplev.c b/gcc/toplev.c index 90a3311..655aa80 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -612,6 +612,8 @@ char *lang_options[] = "-Wno-overloaded-virtual", "-Wenum-clash", "-Wno-enum-clash", + "-Wtemplate-debugging", + "-Wno-template-debugging", /* these are for obj c */ "-lang-objc", @@ -3222,12 +3224,18 @@ You Lose! You must define PREFERRED_DEBUGGING_TYPE! filename = argv[i]; } - /* Inlining does not work if not optimizing, - so force it not to be done. */ if (optimize == 0) { + /* Inlining does not work if not optimizing, + so force it not to be done. */ flag_no_inline = 1; warn_inline = 0; + + /* The c_decode_option and lang_decode_option functions set + this to `2' if -Wall is used, so we can avoid giving out + lots of errors for people who don't realize what -Wall does. */ + if (warn_uninitialized == 1) + warning ("-Wuninitialized is not supported without -O"); } #ifdef OVERRIDE_OPTIONS |