diff options
author | Joseph Myers <jsm@polyomino.org.uk> | 2002-08-21 17:31:36 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2002-08-21 17:31:36 +0100 |
commit | b462d4abc6d0857ed7df3467b98b5df12e9d6329 (patch) | |
tree | 30649eba81c572d239272d325637fe865d100f92 /gcc/c-decl.c | |
parent | e9a25cc86005a07510e1c83f39e43cd2fe3aaedb (diff) | |
download | gcc-b462d4abc6d0857ed7df3467b98b5df12e9d6329.zip gcc-b462d4abc6d0857ed7df3467b98b5df12e9d6329.tar.gz gcc-b462d4abc6d0857ed7df3467b98b5df12e9d6329.tar.bz2 |
re PR c/4319 (short accepted on typedef'd char)
* c-decl.c (grokdeclarator): Make invalid combinations with long,
short, signed or unsigned into hard errors. Fixes PR c/4319.
Also make duplicate modifiers such as "short short" into hard
errors.
testsuite:
* gcc.dg/typespec-1.c: New test.
From-SVN: r56492
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index d61d955..bbf1544 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3556,7 +3556,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) } } else if (specbits & (1 << (int) i)) - pedwarn ("duplicate `%s'", IDENTIFIER_POINTER (id)); + error ("duplicate `%s'", IDENTIFIER_POINTER (id)); /* Diagnose "__thread extern". Recall that this list is in the reverse order seen in the text. */ @@ -3689,12 +3689,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) else { ok = 1; - if (!explicit_int && !defaulted_int && !explicit_char && pedantic) + if (!explicit_int && !defaulted_int && !explicit_char) { - pedwarn ("long, short, signed or unsigned used invalidly for `%s'", - name); - if (flag_pedantic_errors) - ok = 0; + error ("long, short, signed or unsigned used invalidly for `%s'", + name); + ok = 0; } } |