Commit a2468e45 by Brendan Kehoe

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
parent 48fb792a
......@@ -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;
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment