summaryrefslogtreecommitdiffstats
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-21 16:31:36 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-21 16:31:36 +0000
commit594cf47ef35e3fc2d3ac733f2945d0a969262fd5 (patch)
tree30649eba81c572d239272d325637fe865d100f92 /gcc/c-decl.c
parentf9ab9bb4e2c1dd98f1d33dded7c61cf5392b12a3 (diff)
downloadppe42-gcc-594cf47ef35e3fc2d3ac733f2945d0a969262fd5.tar.gz
ppe42-gcc-594cf47ef35e3fc2d3ac733f2945d0a969262fd5.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56492 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index d61d9557be6..bbf1544bd88 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;
}
}
OpenPOWER on IntegriCloud