This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/41793] New: About Long long bit field
- From: "shenrfen at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Oct 2009 09:06:15 -0000
- Subject: [Bug c/41793] New: About Long long bit field
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Test case:
struct s
{
unsigned long long a:2;
unsigned long long b:40;
unsigned long long c:22;
};
int main()
{
struct s t = {1, 2, 3};
printf("0x%llx\n",(t.b-8));
}
The output of gcc42 is 0xfffffffffa (which is yield to be 40bits)
Why not 0xfffffffffffffffa (It should be 64bits)
--
Summary: About Long long bit field
Product: gcc
Version: 4.2.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: shenrfen at gmail dot com
GCC build triplet: x86
GCC host triplet: x86
GCC target triplet: x86
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41793