[prev in list] [next in list] [prev in thread] [next in thread]
List: gcc-patches
Subject: Re: PR 21438 : Warning about division by zero depends on lexical form
From: "=?ISO-8859-1?Q?Manuel_L=F3pez-Ib=E1=F1ez?=" <lopezibanez () gmail ! com>
Date: 2007-01-30 0:31:59
Message-ID: 6c33472e0701291631n6a5bb0e5r3842cd8a7f8530d () mail ! gmail ! com
[Download RAW message or body]
On 29/01/07, Mark Mitchell <mark@codesourcery.com> wrote:
> Manuel López-Ibáñez wrote:
>
> > 2007-01-14 Andrew Pinski <pinskia@gmail.com>
> > Manuel Lopez-Ibanez <manu@gcc.gnu.org>
> >
> > PR c/21438
> > * gcc/c-typeck.c (build_binary_op): Don't give division by zero
> > warning if integer zero is promoted to REAL_TYPE.
> >
> > testsuite:
> > 2007-01-14 Andrew Pinski <pinskia@gmail.com>
> > Manuel Lopez-Ibanez <manu@gcc.gnu.org>
> >
> > PR c/21438
> > * gcc.dg/Wdiv-by-zero.c: New.
>
> I'll let a C maintainer review these bits.
>
It seems that, as Dirk explains, this is actually the intended behaviour:
Joseph says: "the C front end doesn't
warn for division by a floating point zero constant (although it warns for
division of a floating point value by an integer zero) since explicit
division by 0.0 is used as a way of generating Inf and NaN."
http://gcc.gnu.org/ml/gcc-patches/2006-01/msg02184.html
So I think that the PR is invalid and thus this patch is useless. :-(
Am I wrong?
Manuel.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic