[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-29 22:13:05
Message-ID: 6c33472e0701291413j6ad9e7c8g29171b5f6c27e9f8 () mail ! gmail ! com
[Download RAW message or body]

On 29/01/07, Dirk Mueller <dmueller@suse.de> wrote:
> On Sunday, 14. January 2007 16:16, Manuel López-Ibáñez wrote:
>
> > The C front-end does not warning about division by zero for floating
> > point because it is a legitimate way of obtaining infinities and NaNs.
>
> only if division by zero is a real constant, not if it is an integer constant.
>
> > With this patch we don't emit the warning if the integer zero is
> > promoted to real type.
>
> .. which is not intended.

Really? Strange. Well, I can turn the patch around and fix the C++
front-end to follow the C front-end.

> > The C++ front-end, on the contrary, warns always. Is this an inconsistency?
>
> Yes, I submitted a patch about this a few months ago to fix this, but
> unfortunately it was never approved (there was a discussion about it though
> where I lerned the difference between 0.0/0.0 and 0.0/0).
>
> >+  1.0f/0,      /* { dg-bogus "division by zero" } */
>
> it *should* warn here.

Could you point me to the discussion or give some hint to find it?

Cheers,

Manuel.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic