summaryrefslogtreecommitdiff
path: root/gcc/cppinit.c
diff options
context:
space:
mode:
authorNeil Booth <neilb@earthling.net>2000-11-26 17:31:13 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-11-26 17:31:13 +0000
commitbdb05a7b49ee8569b9efa1b0e0401b3026e1034e (patch)
treeb125a3451c60a8ac14f5f3f3cd8afb06f601958a /gcc/cppinit.c
parente1085962754472b391d366d591f66e2413c8faa7 (diff)
downloadgcc-bdb05a7b49ee8569b9efa1b0e0401b3026e1034e.tar.gz
cpplib.h (struct cpp_reader): Remove lang_asm.
* cpplib.h (struct cpp_reader): Remove lang_asm. (struct cpp_options): Remove c89. New members lang, extended_numbers. * cppexp.c (parse_number): Use them. * cpphash.h (VALID_SIGN): Use them. * cppinit.c (set_lang, cpp_start_read): Update. * cpplex.c (parse_string, _cpp_lex_token): Update. * cpplib.c (_cpp_handle_directive): Update. * cppmacro.c (parse_args): Update. * cppmain.c (scan_buffer): Update. From-SVN: r37761
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r--gcc/cppinit.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index 2f190cd1b90..e0b7c4e28ad 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -431,10 +431,11 @@ set_lang (pfile, lang)
{
struct cpp_pending *pend = CPP_OPTION (pfile, pending);
- /* Default to zero. */
- CPP_OPTION (pfile, lang_asm) = 0;
+ /* Defaults. */
+ CPP_OPTION (pfile, lang) = lang;
CPP_OPTION (pfile, objc) = 0;
CPP_OPTION (pfile, cplusplus) = 0;
+ CPP_OPTION (pfile, extended_numbers) = 1; /* Allowed in GNU C and C99. */
switch (lang)
{
@@ -444,7 +445,6 @@ set_lang (pfile, lang)
CPP_OPTION (pfile, dollars_in_ident) = 1;
CPP_OPTION (pfile, cplusplus_comments) = 1;
CPP_OPTION (pfile, digraphs) = 1;
- CPP_OPTION (pfile, c89) = 0;
CPP_OPTION (pfile, c99) = 1;
new_pending_directive (pend, "__STDC_VERSION__=199901L", cpp_define);
break;
@@ -453,7 +453,6 @@ set_lang (pfile, lang)
CPP_OPTION (pfile, dollars_in_ident) = 1;
CPP_OPTION (pfile, cplusplus_comments) = 1;
CPP_OPTION (pfile, digraphs) = 1;
- CPP_OPTION (pfile, c89) = 1;
CPP_OPTION (pfile, c99) = 0;
break;
@@ -465,8 +464,8 @@ set_lang (pfile, lang)
CPP_OPTION (pfile, dollars_in_ident) = 0;
CPP_OPTION (pfile, cplusplus_comments) = 0;
CPP_OPTION (pfile, digraphs) = lang == CLK_STDC94;
- CPP_OPTION (pfile, c89) = 1;
CPP_OPTION (pfile, c99) = 0;
+ CPP_OPTION (pfile, extended_numbers) = 0;
new_pending_directive (pend, "__STRICT_ANSI__", cpp_define);
break;
case CLK_STDC99:
@@ -474,7 +473,6 @@ set_lang (pfile, lang)
CPP_OPTION (pfile, dollars_in_ident) = 0;
CPP_OPTION (pfile, cplusplus_comments) = 1;
CPP_OPTION (pfile, digraphs) = 1;
- CPP_OPTION (pfile, c89) = 0;
CPP_OPTION (pfile, c99) = 1;
new_pending_directive (pend, "__STRICT_ANSI__", cpp_define);
new_pending_directive (pend, "__STDC_VERSION__=199901L", cpp_define);
@@ -489,7 +487,6 @@ set_lang (pfile, lang)
CPP_OPTION (pfile, dollars_in_ident) = 1;
CPP_OPTION (pfile, cplusplus_comments) = 1;
CPP_OPTION (pfile, digraphs) = 1;
- CPP_OPTION (pfile, c89) = 0;
CPP_OPTION (pfile, c99) = 0;
CPP_OPTION (pfile, objc) = 1;
new_pending_directive (pend, "__OBJC__", cpp_define);
@@ -503,7 +500,6 @@ set_lang (pfile, lang)
CPP_OPTION (pfile, dollars_in_ident) = lang == CLK_GNUCXX;
CPP_OPTION (pfile, cplusplus_comments) = 1;
CPP_OPTION (pfile, digraphs) = 1;
- CPP_OPTION (pfile, c89) = 0;
CPP_OPTION (pfile, c99) = 0;
new_pending_directive (pend, "__cplusplus", cpp_define);
break;
@@ -514,9 +510,7 @@ set_lang (pfile, lang)
CPP_OPTION (pfile, dollars_in_ident) = 0; /* Maybe not? */
CPP_OPTION (pfile, cplusplus_comments) = 1;
CPP_OPTION (pfile, digraphs) = 0;
- CPP_OPTION (pfile, c89) = 0;
CPP_OPTION (pfile, c99) = 0;
- CPP_OPTION (pfile, lang_asm) = 1;
new_pending_directive (pend, "__ASSEMBLER__", cpp_define);
break;
}
@@ -979,7 +973,7 @@ cpp_start_read (pfile, fname)
CPP_OPTION (pfile, warn_traditional) = 0;
/* Do not warn about invalid token pasting if -lang-asm. */
- if (CPP_OPTION (pfile, lang_asm))
+ if (CPP_OPTION (pfile, lang) == CLK_ASM)
CPP_OPTION (pfile, warn_paste) = 0;
/* Set this if it hasn't been set already. */