From a2468e45b484872253f5be220700d09cab6f29d7 Mon Sep 17 00:00:00 2001 From: Brendan Kehoe Date: Thu, 14 Jan 1993 19:35:00 -0500 Subject: 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 --- gcc/c-decl.c | 6 +++++- gcc/toplev.c | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'gcc') 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 -- cgit v1.1