Bug 41794 - About Long long bit field
Summary: About Long long bit field
Status: RESOLVED DUPLICATE of bug 41793
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.2.4
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-22 09:22 UTC by ShenRuifen
Modified: 2009-10-22 09:32 UTC (History)
2 users (show)

See Also:
Host: x86
Target: x86
Build: x86
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ShenRuifen 2009-10-22 09:22:27 UTC
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)
Comment 1 Andreas Schwab 2009-10-22 09:32:58 UTC

*** This bug has been marked as a duplicate of 41793 ***