From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6758 invoked by alias); 19 May 2006 16:36:13 -0000 Received: (qmail 6153 invoked by alias); 19 May 2006 16:35:57 -0000 Date: Fri, 19 May 2006 16:36:00 -0000 Message-ID: <20060519163557.6152.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/27682] float to int conversion doesn't raise invalid exception In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "joseph at codesourcery dot com" 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 X-SW-Source: 2006-05/txt/msg01913.txt.bz2 List-Id: ------- Comment #3 from joseph at codesourcery dot com 2006-05-19 16:35 ------- Subject: Re: New: float to int conversion doesn't raise invalid exception On Fri, 19 May 2006, janis at gcc dot gnu dot org wrote: > GCC claims to follow C99 Annex F when converting a floating value to an integer It doesn't (in that it doesn't define __STDC_IEC_559__). But it should aim to do so (provided the user doesn't specify options such as -fno-trapping-math in this case). > A possibly-related issue is that this macro is defined in a header file > provided by glibc, not by GCC. That's a bug in the combination of glibc and GCC, requiring cooperation between them to fix. The macro must be defined from the start of the translation unit without any headers needing to be included; the same also applies to __STDC_ISO_10646__ which is definitely a property of the library. My suggested solution is still as at : an implicitly included header that is provided by the library, makes such definitions, *does not include other glibc headers such as features.h* (because the source file may define feature test macros later before it first explicitly includes a system header), and whose absence is silently ignored by the compiler (in order to support older glibc without the header). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27682