[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:       Dirk Mueller <dmueller () suse ! de>
Date:       2007-01-29 22:04:39
Message-ID: 200701292304.40137.dmueller () suse ! de
[Download RAW message or body]

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. 

> 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. 


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

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