Bug 4319 - short accepted on typedef'd char
|
Bug#:
4319
|
Product: gcc
|
Version: 2.96 (redhat)
|
|
Host:
|
Target:
|
Build:
|
|
Status: RESOLVED
|
Severity: normal
|
Priority: P3
|
|
Resolution: FIXED
|
Assigned To: jsm28@gcc.gnu.org
|
Reported By: jfoster@cs.berkeley.edu
|
|
Component: c
|
Target Milestone: ---
|
|
Summary: short accepted on typedef'd char
|
|
Keywords: accepts-invalid
|
|
Opened: 2001-09-13 13:26
|
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.