summaryrefslogtreecommitdiff
path: root/gcc/cccp.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1999-12-14 16:05:23 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1999-12-14 16:05:23 +0000
commitdd48bf24dd4790789c4500ad5f801d61a7e4ac6b (patch)
tree94fb7f433efa5a20773aff67980a0d17cc9938cc /gcc/cccp.c
parent82b85d083a367b761c1fde3d1a8ac61e73b5b13b (diff)
downloadgcc-dd48bf24dd4790789c4500ad5f801d61a7e4ac6b.tar.gz
* cppp.c (main): Set trigraphs and __STRICT_ANSI__ as
appropriate for -lang-c89 and -std=*. * cppinit.c (cpp_handle_option): Likewise. (new_pending_define): New, split out from cpp_handle_option. * gcc.c (default_compilers): Don't define __STRICT_ANSI__ or enable trigraphs for -ansi/-std=*. * ginclude/stdarg.h (__va_copy): New. (va_copy): Don't define for C89. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30921 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cccp.c')
-rw-r--r--gcc/cccp.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index a21daf1d510..4acc21470c4 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -1454,7 +1454,11 @@ main (argc, argv)
if (! strcmp (argv[i], "-lang-c"))
cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
else if (! strcmp (argv[i], "-lang-c89"))
- cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+ {
+ cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+ no_trigraphs = 0;
+ pend_defs[i] = "__STRICT_ANSI__=199000";
+ }
else if (! strcmp (argv[i], "-lang-c++"))
cplusplus = 1, cplusplus_comments = 1, c89 = 0, c9x = 0, objc = 0;
else if (! strcmp (argv[i], "-lang-objc"))
@@ -1472,15 +1476,37 @@ main (argc, argv)
break;
case 's':
- if (!strcmp (argv[i], "-std=iso9899:1990")
- || !strcmp (argv[i], "-std=iso9899:199409")
- || !strcmp (argv[i], "-std=c89")
- || !strcmp (argv[i], "-std=gnu89"))
- cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+ if (!strcmp (argv[i], "-std=gnu89"))
+ {
+ cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+ }
+ else if (!strcmp (argv[i], "-std=gnu9x")
+ || !strcmp (argv[i], "-std=gnu99"))
+ {
+ cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
+ }
+ else if (!strcmp (argv[i], "-std=iso9899:1990")
+ || !strcmp (argv[i], "-std=c89"))
+ {
+ cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+ no_trigraphs = 0;
+ pend_defs[i] = "__STRICT_ANSI__=199000";
+ }
+ else if (!strcmp (argv[i], "-std=iso9899:199409"))
+ {
+ cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+ no_trigraphs = 0;
+ pend_defs[i] = "__STRICT_ANSI__=199409";
+ }
else if (!strcmp (argv[i], "-std=iso9899:199x")
+ || !strcmp (argv[i], "-std=iso9899:1999")
|| !strcmp (argv[i], "-std=c9x")
- || !strcmp (argv[i], "-std=gnu9x"))
- cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
+ || !strcmp (argv[i], "-std=c99"))
+ {
+ cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
+ no_trigraphs = 0;
+ pend_defs[i] = "__STRICT_ANSI__=199900";
+ }
break;
case 'w':