This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/37560] New: bitfield not promoted to int
- From: "clemens at ladisch dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Sep 2008 14:33:58 -0000
- Subject: [Bug c/37560] New: bitfield not promoted to int
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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