From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17344 invoked by alias); 22 Nov 2013 13:10:45 -0000 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 Received: (qmail 17284 invoked by uid 48); 22 Nov 2013 13:10:40 -0000 From: "jjcogliati-r1 at yahoo dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors Date: Fri, 22 Nov 2013 13:10:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: jjcogliati-r1 at yahoo dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg02307.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53001 --- Comment #30 from Joshua Cogliati --- Yes, it is fixed so far as I am concerned. I checked out gcc trunk 205109,= and bootstraped it and tried it out on: int main(int argc, char ** argv) { int i =3D 3.14; return i; } int foo(double x) { return x; } float foo2(double x) { return x; } and without the flag it didn't warn, but with the flag it did: gcc -Wall -Wfloat-conversion -o float_test float_test.c float_test.c: In function =E2=80=98main=E2=80=99: float_test.c:2:3: warning: conversion to =E2=80=98int=E2=80=99 alters =E2= =80=98double=E2=80=99 constant value [-Wfloat-conversion] int i =3D 3.14; ^ float_test.c: In function =E2=80=98foo=E2=80=99: float_test.c:8:3: warning: conversion to =E2=80=98int=E2=80=99 from =E2=80= =98double=E2=80=99 may alter its value [-Wfloat-conversion] return x; ^ float_test.c: In function =E2=80=98foo2=E2=80=99: float_test.c:12:3: warning: conversion to =E2=80=98float=E2=80=99 from =E2= =80=98double=E2=80=99 may alter its value [-Wfloat-conversion] return x; ^ I think there are two things remaining to be done.=20=20 1. http://gcc.gnu.org/gcc-4.9/changes.html does not yet list it as a change= ,=20 2. for gcc 4.10 (or what ever the next gcc version is) I think it might be worth considering as a -Wextra or -Wall. That however would be a separate = bug number and would require something like the Patch to fixup gcc float conversions in GCC and another patch to turn it on with the flag. >>From gcc-bugs-return-435531-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Nov 22 13:11:29 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 18187 invoked by alias); 22 Nov 2013 13:11:28 -0000 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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 18133 invoked by uid 48); 22 Nov 2013 13:11:25 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/59243] [SH] Build fails during compiling libjava/interpret.cc with segfault Date: Fri, 22 Nov 2013 13:11:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: unknown X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg02308.txt.bz2 Content-length: 284 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59243 --- Comment #1 from Oleg Endo --- (In reply to Kazumoto Kojima from comment #0) > Created attachment 31270 [details] > A reduced test case Thanks. This is a very good test case. I'm looking into it.