This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]