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