This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/21438] New: Warning about division by zero depends on lexical form
- From: "neil at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 May 2005 08:09:12 -0000
- Subject: [Bug c/21438] New: Warning about division by zero depends on lexical form
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
GCC is supposed to suppress division by zero warnings when floating point.
However the warning is based on the lexical form, i.e. the unpromoted type. I
suggest it should depend on the promoted type.
float f[] = {
1.0f/0.0f, // No warning
1.0f/0 // Warning (and diagnostic is on the wrong line in 3.3 at least)
};
--
Summary: Warning about division by zero depends on lexical form
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: neil at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21438