gcc allows ``short'' to appear with a typedef'd char: typedef unsigned char __u8; __u8 short slot_tablelen; is accepted, but unsigned char short slot_tablelen; is not, which doesn't make sense to me. (In C99, short is not allowed with any typedef'd name -- I'm not sure why it's allowed in gcc.) Release: gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85) Environment: redhat 7.1, x86 How-To-Repeat: gcc bad.c
Responsible-Changed-From-To: unassigned->jsm28 Responsible-Changed-Why: Claiming responsibility for this bug. The fix is trivial, but doing it properly does involve writing a collection of testcases for all the valid and invalid uses of type specifiers.
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed as a bug in current 3.1 CVS. This case will give a warning with -pedantic; there are a lot of cases where warnings conditional on -pedantic ought to be unconditional warnings or errors, and since this is a case of nonsense code it ought to be an unconditional error.
State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed for 3.3.
From: jsm28@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: c/4319 Date: 21 Aug 2002 16:31:37 -0000 CVSROOT: /cvs/gcc Module name: gcc Changes by: jsm28@gcc.gnu.org 2002-08-21 09:31:37 Modified files: gcc : ChangeLog c-decl.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg: typespec-1.c Log message: * 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. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.15225&r2=1.15226 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&r1=1.348&r2=1.349 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2038&r2=1.2039 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/typespec-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1