diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-16 19:09:30 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-16 19:09:30 +0000 |
commit | 07ebd0918cf25bb1c655059560f0e61c126ce554 (patch) | |
tree | 347f17f792ce0f731598ef624fd0f14c6484bffe /gcc/c-parse.in | |
parent | 33b24f9d4cc6c2885b6f8b6df8c9035ceb3c0bbb (diff) | |
download | gcc-07ebd0918cf25bb1c655059560f0e61c126ce554.tar.gz |
* c-common.c (flag_ms_extensions): Move from c++ front end.
* c-common.h (flag_ms_extensions): Declare.
* c-decl.c (c_decode_option): Add -fms-extensions.
(grokfield): Don't accept anonymous structures in ISO C mode;
accept only unnamed anonymous structures in GNU C mode; accept
Plan 9 extensions in MS mode.
* c-parse.in (SAVE_EXT_FLAGS, RESTORE_EXT_FLAGS): Rename from
SAVE/RESTORE_WARN_FLAGS; add flag_iso frobbing; update all callers.
(extension): Clear flag_iso.
* doc/invoke.texi (C Dialect Options): Add -fms-extensions.
* cp-tree.h, decl2.c (flag_ms_extensions): Move to c-common.
* g++.dg/ext/anon-struct1.C: New.
* g++.dg/ext/anon-struct2.C: New.
* g++.dg/ext/anon-struct3.C: New.
* gcc.dg/anon-struct-1.c: New.
* gcc.dg/anon-struct-2.c: New.
* gcc.dg/anon-struct-3.c: New.
* gcc.dg/20011008-1.c: Adjust warning text.
* gcc.dg/20020527-1.c: Add -fms-extensions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54670 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parse.in')
-rw-r--r-- | gcc/c-parse.in | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in index c5c499cf048..5dfecb8741f 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -298,17 +298,19 @@ static GTY(()) tree declspec_stack; /* For __extension__, save/restore the warning flags which are controlled by __extension__. */ -#define SAVE_WARN_FLAGS() \ +#define SAVE_EXT_FLAGS() \ size_int (pedantic \ | (warn_pointer_arith << 1) \ - | (warn_traditional << 2)) + | (warn_traditional << 2) \ + | (flag_iso << 3)) -#define RESTORE_WARN_FLAGS(tval) \ +#define RESTORE_EXT_FLAGS(tval) \ do { \ int val = tree_low_cst (tval, 0); \ pedantic = val & 1; \ warn_pointer_arith = (val >> 1) & 1; \ warn_traditional = (val >> 2) & 1; \ + flag_iso = (val >> 3) & 1; \ } while (0) ifobjc @@ -394,7 +396,7 @@ end ifobjc else error ("argument of `asm' is not a constant string"); } | extension extdef - { RESTORE_WARN_FLAGS ($1); } + { RESTORE_EXT_FLAGS ($1); } ; datadef: @@ -517,7 +519,7 @@ unary_expr: /* __extension__ turns off -pedantic for following primary. */ | extension cast_expr %prec UNARY { $$ = $2; - RESTORE_WARN_FLAGS ($1); } + RESTORE_EXT_FLAGS ($1); } | unop cast_expr %prec UNARY { $$ = build_unary_op ($1, $2, 0); overflow_warning ($$); } @@ -865,7 +867,7 @@ decl: | declspecs ';' { shadow_tag ($1); } | extension decl - { RESTORE_WARN_FLAGS ($1); } + { RESTORE_EXT_FLAGS ($1); } ; /* A list of declaration specifiers. These are: @@ -1863,7 +1865,7 @@ component_decl: { $$ = NULL_TREE; } | extension component_decl { $$ = $2; - RESTORE_WARN_FLAGS ($1); } + RESTORE_EXT_FLAGS ($1); } ; components: @@ -2664,10 +2666,11 @@ identifiers_or_typenames: extension: EXTENSION - { $$ = SAVE_WARN_FLAGS(); + { $$ = SAVE_EXT_FLAGS(); pedantic = 0; warn_pointer_arith = 0; - warn_traditional = 0; } + warn_traditional = 0; + flag_iso = 0; } ; ifobjc |