OSDN Git Service

* g-expect.adb (Get_Command_Output): When expanding the output buffer
[pf3gnuchains/gcc-fork.git] / gcc / c-opts.c
index 76ad827..b3878ea 100644 (file)
@@ -39,6 +39,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
 #include "opts.h"
 #include "options.h"
 #include "mkdeps.h"
+#include "target.h"
 
 #ifndef DOLLARS_IN_IDENTIFIERS
 # define DOLLARS_IN_IDENTIFIERS true
@@ -278,7 +279,12 @@ c_common_handle_option (size_t scode, const char *arg, int value)
     {
     default:
       if (cl_options[code].flags & (CL_C | CL_CXX | CL_ObjC | CL_ObjCXX))
-       break;
+       {
+         if ((option->flags & CL_TARGET)
+             && ! targetcm.handle_c_option (scode, arg, value))
+           result = 0;
+         break;
+       }
 #ifdef CL_Fortran
       if (lang_fortran && (cl_options[code].flags & (CL_Fortran)))
        break;
@@ -395,9 +401,8 @@ c_common_handle_option (size_t scode, const char *arg, int value)
        warn_sign_compare = value;
       warn_switch = value;
       warn_strict_aliasing = value;
+      warn_address = value;
       warn_strict_overflow = value;
-      warn_string_literal_comparison = value;
-      warn_always_true = value;
       warn_array_bounds = value;
 
       /* Only warn about unknown pragmas that are not in system
@@ -1024,6 +1029,13 @@ c_common_post_options (const char **pfilename)
   if (flag_inline_functions)
     flag_inline_trees = 2;
 
+  /* By default we use C99 inline semantics in GNU99 or C99 mode.  C99
+     inline semantics are not supported in GNU89 or C89 mode.  */
+  if (flag_gnu89_inline == -1)
+    flag_gnu89_inline = !flag_isoc99;
+  else if (!flag_gnu89_inline && !flag_isoc99)
+    error ("-fno-gnu89-inline is only supported in GNU99 or C99 mode");
+
   /* If we are given more than one input file, we must use
      unit-at-a-time mode.  */
   if (num_in_fnames > 1)
@@ -1065,6 +1077,23 @@ c_common_post_options (const char **pfilename)
   if (warn_overlength_strings == -1 || c_dialect_cxx ())
     warn_overlength_strings = 0;
 
+  /* Adjust various flags for C++ based on command-line settings.  */
+  if (c_dialect_cxx ())
+    {
+      if (!flag_permissive)
+       {
+         flag_pedantic_errors = 1;
+         cpp_opts->pedantic_errors = 1;
+       }
+      if (!flag_no_inline)
+       {
+         flag_inline_trees = 1;
+         flag_no_inline = 1;
+       }
+      if (flag_inline_functions)
+       flag_inline_trees = 2;
+    }
+
   /* Special format checking options don't work without -Wformat; warn if
      they are used.  */
   if (!warn_format)