diff options
author | Neil Booth <neil@gcc.gnu.org> | 2003-05-04 20:03:55 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2003-05-04 20:03:55 +0000 |
commit | a8eb6044a9468a56cab63890820e17101ce8fd64 (patch) | |
tree | db0e598a611fbe90ebcaf267b9665fd02c67a70f /gcc/cppinit.c | |
parent | 09780dfb652960d422da1c5a9d81dc536cdf09f4 (diff) | |
download | gcc-a8eb6044a9468a56cab63890820e17101ce8fd64.zip gcc-a8eb6044a9468a56cab63890820e17101ce8fd64.tar.gz gcc-a8eb6044a9468a56cab63890820e17101ce8fd64.tar.bz2 |
cppinit.c (cpp_create_reader, [...]): Warn about trigraphs unless explicity set or -trigraphs.
* cppinit.c (cpp_create_reader, post_options): Warn about
trigraphs unless explicity set or -trigraphs.
* cpplex.c (warn_in_comment): New.
(_cpp_process_line_notes): Better handling of -Wtrigraphs.
(_cpp_skip_block_comment): Add call to _cpp_process_line_notes.
* doc/cppopts.texi, doc/cpp.texi: Update.
testsuite:
* gcc.dg/cpp/Wtrigraphs.c: Update.
* gcc.dg/cpp/Wtrigraphs-2.c: New tests.
From-SVN: r66459
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r-- | gcc/cppinit.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c index 74679c0..4066ee3 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -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. */ |