From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24776 invoked by alias); 22 Oct 2009 09:22:41 -0000 Received: (qmail 24673 invoked by uid 48); 22 Oct 2009 09:22:27 -0000 Date: Thu, 22 Oct 2009 09:22:00 -0000 Subject: [Bug c/41794] New: About Long long bit field X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "shenrfen at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg01885.txt.bz2 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=41794