This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING^3] PR 21438 : Warning about division by zero depends on lexical form
- From: "Manuel López-Ibáñez" <lopezibanez at gmail dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "Mark Mitchell" <mark at codesourcery dot com>
- Date: Thu, 1 Mar 2007 21:13:55 +0000
- Subject: Re: [PING^3] PR 21438 : Warning about division by zero depends on lexical form
- References: <6c33472e0702100802v4469d3dehd49655d67a552da9@mail.gmail.com> <6c33472e0702180347x367cd15pa77c9d24143e0e24@mail.gmail.com> <6c33472e0703011018m3b24fd6by68723c3d8191b983@mail.gmail.com> <Pine.LNX.4.64.0703012009460.5655@digraph.polyomino.org.uk>
On 01/03/07, Joseph S. Myers <joseph@codesourcery.com> wrote:
On Thu, 1 Mar 2007, Manuel López-Ibáñez wrote:
> Still pending resolution:
> http://gcc.gnu.org/ml/gcc-patches/2007-02/msg00925.html
I don't see what there is supposed to be here for me to resolve. If the
patch at <http://gcc.gnu.org/ml/gcc-patches/2007-01/msg01166.html> is
still awaiting approval rather than withdrawn or revised it is OK.
That is what I wanted to hear. Thanks.
The int i = int(1.0/0.0); is a C++ matter, but is not a matter of a
division-by-zero warning; rather a matter that we should warn for
conversion of any constant infinity or NaN to an integer type, whether
that infinity or NaN is obtained by division by zero or by using built-in
functions. This should go with other warnings for out-of-range
floating-to-integer conversions.
Hum, that is a valid point. But ignoring that particular example for a
moment, the C front-end does not warn for 1.0/0.0 and with my patch
neither for 1.0/0 while the C++ front-end warns for both. So my
question is whether I should prepare a patch for the C++ front-end to
warn for both. But, I guess that, yes, that is not for you to decide,
so I should wait for a C++ front-end maintainer to speak clearly.
I was just trying to solve the inconsistency before making it worse
with the above patch. I guess things don't work that way.
Cheers,
Manuel.