diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-11-10 16:24:26 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-11-10 16:24:26 +0000 |
commit | 2a1274904a9ddd3db9aba160e2d094090e99bcfd (patch) | |
tree | 99368d90c8e0b51f751a07819e6cdd7a699961c6 /gcc/c-decl.c | |
parent | 1e4ebc0da7ef9dcb5f35a71436c30e0e2877c458 (diff) | |
download | gcc-2a1274904a9ddd3db9aba160e2d094090e99bcfd.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58983 138bc75d-0d04-0410-961f-82ee72b054a4
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 e5a43fe0f25..9c3b58fc78f 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. */ |