c/4319: short accepted on typedef'd char

jfoster@cs.berkeley.edu jfoster@cs.berkeley.edu
Thu Sep 13 13:26:00 GMT 2001


>Number:         4319
>Category:       c
>Synopsis:       short accepted on typedef'd char
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 13 13:26:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jeff Foster
>Release:        gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)
>Organization:
>Environment:
redhat 7.1, x86
>Description:
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.)
>How-To-Repeat:
gcc bad.c
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="bad.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bad.c"

dHlwZWRlZiB1bnNpZ25lZCBjaGFyIF9fdTg7Cl9fdTggc2hvcnQgc2xvdF90YWJsZWxlbjsK



More information about the Gcc-bugs mailing list