cppinit.c (cpp_create_reader, [...]): Warn about trigraphs unless explicity set or...
[platform/upstream/gcc.git] / gcc / cppinit.c
index 74679c0..4066ee3 100644 (file)
@@ -149,6 +149,7 @@ cpp_create_reader (lang, table)
   CPP_OPTION (pfile, show_column) = 1;
   CPP_OPTION (pfile, tabstop) = 8;
   CPP_OPTION (pfile, operator_names) = 1;
+  CPP_OPTION (pfile, warn_trigraphs) = 2;
   CPP_OPTION (pfile, warn_endif_labels) = 1;
   CPP_OPTION (pfile, warn_deprecated) = 1;
   CPP_OPTION (pfile, warn_long_long) = !CPP_OPTION (pfile, c99);
@@ -554,6 +555,9 @@ post_options (pfile)
       CPP_OPTION (pfile, traditional) = 0;
     }
 
+  if (CPP_OPTION (pfile, warn_trigraphs) == 2)
+    CPP_OPTION (pfile, warn_trigraphs) = !CPP_OPTION (pfile, trigraphs);
+
   if (CPP_OPTION (pfile, traditional))
     {
       /* Traditional CPP does not accurately track column information.  */