c/10333: typeof (bitfield) is accepted but doesn't work

Christian Ehrhardt ehrhardt@mathematik.uni-ulm.de
Mon Apr 7 11:56:00 GMT 2003


>Number:         10333
>Category:       c
>Synopsis:       typeof (bitfield) is accepted but doesn't work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 07 11:56:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Christian Ehrhardt
>Release:        3.2,3.3,3.4
>Organization:
>Environment:
SunOS theseus 5.9 Generic_112233-03 sun4u sparc SUNW,Ultra-4
>Description:
Using typeof on a bit field is accepted but it doesn't create a bit
field. IMHO typeof should be treated the same as sizeof, i.e. it should
not be allow on bit fields. Alternatively the following should create
a global bit field y, but it in fact creates an unsigned int y:


struct  {
	unsigned int a:3;
} x;

typeof (x.a) y;

int main ()
{
	y = 100;
	printf ("%d %d\n", y, sizeof (y));
}

    regards   Christian

>How-To-Repeat:
See description.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list