OSDN Git Service

2008-05-23 Rafael Espindola <espindola@google.com>
[pf3gnuchains/gcc-fork.git] / gcc / c-opts.c
index 4cb7687..eda0f48 100644 (file)
@@ -1,5 +1,5 @@
 /* C/ObjC/C++ command line option handling.
-   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
    Contributed by Neil Booth.
 
@@ -407,6 +407,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
       if (warn_strict_overflow == -1)
        warn_strict_overflow = value;
       warn_array_bounds = value;
+      warn_volatile_register_var = value;
 
       /* Only warn about unknown pragmas that are not in system
         headers.  */
@@ -1106,18 +1107,6 @@ c_common_post_options (const char **pfilename)
   /* Adjust various flags for C++ based on command-line settings.  */
   if (c_dialect_cxx ())
     {
-      if (!flag_permissive)
-       {
-         flag_pedantic_errors = 1;
-         /* FIXME: For consistency pedantic_errors should have the
-            same value in the front-end and in CPP. However, this
-            will break existing applications. The right fix is
-            disentagle flag_permissive from flag_pedantic_errors,
-            create a new diagnostic function permerror that is
-            controlled by flag_permissive and convert most C++
-            pedwarns to this new function.
-         cpp_opts->pedantic_errors = 1;  */
-       }
       if (!flag_no_inline)
        {
          flag_inline_trees = 1;
@@ -1238,6 +1227,9 @@ c_common_init (void)
   if (version_flag)
     c_common_print_pch_checksum (stderr);
 
+  /* Has to wait until now so that cpplib has its hash table.  */
+  init_pragma ();
+
   if (flag_preprocess_only)
     {
       finish_options ();
@@ -1245,9 +1237,6 @@ c_common_init (void)
       return false;
     }
 
-  /* Has to wait until now so that cpplib has its hash table.  */
-  init_pragma ();
-
   return true;
 }
 
@@ -1438,6 +1427,8 @@ sanitize_cpp_opts (void)
       flag_dump_includes = 0;
       flag_no_line_commands = 1;
     }
+  else if (cpp_opts->deps.missing_files)
+    error ("-MG may only be used with -M or -MM");
 
   cpp_opts->unsigned_char = !flag_signed_char;
   cpp_opts->stdc_0_in_system_headers = STDC_0_IN_SYSTEM_HEADERS;
@@ -1679,6 +1670,7 @@ handle_OPT_d (const char *arg)
       case 'M':                        /* Dump macros only.  */
       case 'N':                        /* Dump names.  */
       case 'D':                        /* Dump definitions.  */
+      case 'U':                        /* Dump used macros.  */
        flag_dump_macros = c;
        break;