diff options
author | Neil Booth <neilb@earthling.net> | 2000-07-11 08:58:28 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2000-07-11 08:58:28 +0000 |
commit | 9b55f29a8432a6e841ad1e842585666562c6eca3 (patch) | |
tree | 34bafa80cd73a9004dc7444f72a7555fb0602318 /gcc/cppinit.c | |
parent | bb6a53c76b68192547959b6717c5632a9ee225bd (diff) | |
download | gcc-9b55f29a8432a6e841ad1e842585666562c6eca3.zip gcc-9b55f29a8432a6e841ad1e842585666562c6eca3.tar.gz gcc-9b55f29a8432a6e841ad1e842585666562c6eca3.tar.bz2 |
cppinit.c: (cpp_reader_init): Allow digraphs by default.
* cppinit.c: (cpp_reader_init): Allow digraphs by default.
(handle_option): Set digraphs according to standard.
Merge OPT_lang_c89 handler with OPT_std_c89.
* cpplex.c: (lex_line, can_paste): Honour digraphs in
accordance with the digraphs flag.
* cpplib.h: (struct cpp_options): New option digraphs.
From-SVN: r34956
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r-- | gcc/cppinit.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c index 88a3e8c..db8b6e9 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -418,6 +418,7 @@ cpp_reader_init (pfile) CPP_OPTION (pfile, cplusplus_comments) = 1; CPP_OPTION (pfile, warn_import) = 1; CPP_OPTION (pfile, warn_paste) = 1; + CPP_OPTION (pfile, digraphs) = 1; CPP_OPTION (pfile, discard_comments) = 1; CPP_OPTION (pfile, show_column) = 1; CPP_OPTION (pfile, tabstop) = 8; @@ -1270,6 +1271,7 @@ handle_option (pfile, argc, argv) CPP_OPTION (pfile, traditional) = 1; CPP_OPTION (pfile, cplusplus_comments) = 0; CPP_OPTION (pfile, trigraphs) = 0; + CPP_OPTION (pfile, digraphs) = 0; CPP_OPTION (pfile, warn_trigraphs) = 0; break; case OPT_trigraphs: @@ -1291,23 +1293,16 @@ handle_option (pfile, argc, argv) CPP_OPTION (pfile, cplusplus_comments) = 1; CPP_OPTION (pfile, c89) = 0; CPP_OPTION (pfile, c99) = 1; + CPP_OPTION (pfile, digraphs) = 1; CPP_OPTION (pfile, objc) = 0; break; - case OPT_lang_c89: - CPP_OPTION (pfile, cplusplus) = 0; - CPP_OPTION (pfile, cplusplus_comments) = 0; - CPP_OPTION (pfile, c89) = 1; - CPP_OPTION (pfile, c99) = 0; - CPP_OPTION (pfile, objc) = 0; - CPP_OPTION (pfile, trigraphs) = 1; - new_pending_directive (pend, "__STRICT_ANSI__", cpp_define); - break; case OPT_lang_cplusplus: CPP_OPTION (pfile, cplusplus) = 1; CPP_OPTION (pfile, cplusplus_comments) = 1; CPP_OPTION (pfile, c89) = 0; CPP_OPTION (pfile, c99) = 0; CPP_OPTION (pfile, objc) = 0; + CPP_OPTION (pfile, digraphs) = 1; new_pending_directive (pend, "__cplusplus", cpp_define); break; case OPT_lang_objcplusplus: @@ -1353,6 +1348,7 @@ handle_option (pfile, argc, argv) CPP_OPTION (pfile, c89) = 1; CPP_OPTION (pfile, c99) = 0; CPP_OPTION (pfile, objc) = 0; + CPP_OPTION (pfile, digraphs) = 1; break; case OPT_std_gnu9x: case OPT_std_gnu99: @@ -1360,6 +1356,7 @@ handle_option (pfile, argc, argv) CPP_OPTION (pfile, cplusplus_comments) = 1; CPP_OPTION (pfile, c89) = 0; CPP_OPTION (pfile, c99) = 1; + CPP_OPTION (pfile, digraphs) = 1; CPP_OPTION (pfile, objc) = 0; new_pending_directive (CPP_OPTION (pfile, pending), "__STDC_VERSION__=199901L", cpp_define); @@ -1370,14 +1367,15 @@ handle_option (pfile, argc, argv) /* Fall through */ case OPT_std_iso9899_1990: case OPT_std_c89: + case OPT_lang_c89: CPP_OPTION (pfile, cplusplus) = 0; CPP_OPTION (pfile, cplusplus_comments) = 0; CPP_OPTION (pfile, c89) = 1; CPP_OPTION (pfile, c99) = 0; CPP_OPTION (pfile, objc) = 0; + CPP_OPTION (pfile, digraphs) = opt_code == OPT_std_iso9899_199409; CPP_OPTION (pfile, trigraphs) = 1; - new_pending_directive (CPP_OPTION (pfile, pending), - "__STRICT_ANSI__", cpp_define); + new_pending_directive (pend, "__STRICT_ANSI__", cpp_define); break; case OPT_std_iso9899_199x: case OPT_std_iso9899_1999: @@ -1388,6 +1386,7 @@ handle_option (pfile, argc, argv) CPP_OPTION (pfile, c89) = 0; CPP_OPTION (pfile, c99) = 1; CPP_OPTION (pfile, objc) = 0; + CPP_OPTION (pfile, digraphs) = 1; CPP_OPTION (pfile, trigraphs) = 1; new_pending_directive (CPP_OPTION (pfile, pending), "__STRICT_ANSI__", cpp_define); |