diff options
author | Joseph Myers <jsm@polyomino.org.uk> | 2002-11-10 16:24:26 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2002-11-10 16:24:26 +0000 |
commit | 04e6db94f80811056dee31650a3ccd8483887591 (patch) | |
tree | 99368d90c8e0b51f751a07819e6cdd7a699961c6 /gcc/c-decl.c | |
parent | d663b76d177fbb8e39abca98decf1290628191ac (diff) | |
download | gcc-04e6db94f80811056dee31650a3ccd8483887591.zip gcc-04e6db94f80811056dee31650a3ccd8483887591.tar.gz gcc-04e6db94f80811056dee31650a3ccd8483887591.tar.bz2 |
c-decl.c (grokdeclarator): Make error for duplicate type qualifiers into a pedwarn, disabled for C99.
* c-decl.c (grokdeclarator): Make error for duplicate type
qualifiers into a pedwarn, disabled for C99.
testsuite:
* gcc.dg/c90-idem-qual-2.c, gcc.dg/c99-idem-qual-2.c: New tests.
From-SVN: r58983
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index e5a43fe..9c3b58f 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3541,7 +3541,15 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) } } else if (specbits & (1 << (int) i)) - error ("duplicate `%s'", IDENTIFIER_POINTER (id)); + { + if (i == RID_CONST || i == RID_VOLATILE || i == RID_RESTRICT) + { + if (!flag_isoc99) + pedwarn ("duplicate `%s'", IDENTIFIER_POINTER (id)); + } + else + error ("duplicate `%s'", IDENTIFIER_POINTER (id)); + } /* Diagnose "__thread extern". Recall that this list is in the reverse order seen in the text. */ |