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