This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PING] PR 21438 : Warning about division by zero depends on lexical form
- From: "Manuel López-Ibáñez" <lopezibanez at gmail dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: "Mark Mitchell" <mark at codesourcery dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Sat, 10 Feb 2007 16:02:20 +0000
- Subject: [PING] PR 21438 : Warning about division by zero depends on lexical form
The discussion didn't reach a definitive conclusion:
http://gcc.gnu.org/ml/gcc-patches/2007-01/msg01166.html
It seems that the consensus is that:
* Context matters, so we should warn for int i = int(1.0/0.0); (not
sure how to implement this, but I will try).
* Lexical form should not matter, so warnings for 1.0/0.0 and 1.0/0
should be consistent.
* C and C++ front-ends should agree.
So the only question is:
Do we warn for 1.0/0.0 (like C++ front-end does) or we consider that
it is a legitimate way to obtain infinities so we don't warn (like C
front-end does) ?
Thanks,
Manuel.