From 27fdc0b6702eeddad8825b45a4a38e05caa56f0d Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 11 Jul 2000 08:58:28 +0000 Subject: * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34956 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cppinit.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'gcc/cppinit.c') diff --git a/gcc/cppinit.c b/gcc/cppinit.c index 88a3e8ccaf8..db8b6e92c76 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); -- cgit v1.2.3