From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3575 invoked by alias); 25 Nov 2004 00:32:59 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 3478 invoked by uid 48); 25 Nov 2004 00:32:52 -0000 Date: Thu, 25 Nov 2004 00:32:00 -0000 From: "jakub at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20041125003250.18666.jakub@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/18666] New: Conversion of floating point into bit-fields X-Bugzilla-Reason: CC X-SW-Source: 2004-11/txt/msg02999.txt.bz2 List-Id: Is /* { dg-do run } */ /* { dg-options "-std=c99 -pedantic-errors } */ struct A { unsigned int i : 1; } a; extern void abort (void); int main (void) { a.i = 16.0; if (a.i != 0) abort (); return 0; } a valid test or not? This worked with 3.4.x and earlier, but doesn't any longer. The question is mainly if the type of a.i for the 6.3.1.4/1 purposes is unsigned int (in this case it would be well-defined, 16 is representable in unsigned int and storing 16 into unsigned int i : 1 bitfield is defined), or if the type is integer type with precision 1. -- Summary: Conversion of floating point into bit-fields Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jakub at gcc dot gnu dot org CC: aoliva at redhat dot com,gcc-bugs at gcc dot gnu dot org,joseph at codesourcery dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18666