Commit b462d4ab by Joseph Myers Committed by Joseph Myers

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
parent e9a25cc8
2002-08-21 Joseph S. Myers <jsm@polyomino.org.uk>
* 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.
2002-08-21 Andrew Pinski <pinskia@physics.uc.edu>
Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
......
......@@ -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;
}
}
......
2002-08-21 Joseph S. Myers <jsm@polyomino.org.uk>
* gcc.dg/typespec-1.c: New test.
2002-08-20 Devang Patel <dpatel@apple.com>
* objc.dg/proto-hier-2.m: New test.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment