[Bug c/37560] New: bitfield not promoted to int
clemens at ladisch dot de
gcc-bugzilla@gcc.gnu.org
Wed Sep 17 14:35:00 GMT 2008
In the following program, the type of the assignment expression "f.x = 1"
should be int, according to the integer promotion rules.
However, gcc 4.xx (on all architectures I've tested) prints "1".
#include <stdio.h>
int main()
{
struct foo { int x:1; } f;
printf("%u\n", sizeof(f.x = 1));
return 0;
}
--
Summary: bitfield not promoted to int
Product: gcc
Version: 4.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: clemens at ladisch dot de
GCC target triplet: x86_64-suse-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37560
More information about the Gcc-bugs
mailing list