This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c/10333: typeof (bitfield) is accepted but doesn't work
- From: Christian Ehrhardt <ehrhardt at mathematik dot uni-ulm dot de>
- To: gcc-gnats at gcc dot gnu dot org
- Date: 7 Apr 2003 11:50:29 -0000
- Subject: c/10333: typeof (bitfield) is accepted but doesn't work
- Reply-to: Christian Ehrhardt <ehrhardt at mathematik dot uni-ulm dot de>
>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: