This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
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. With this patch we don't emit the warning if the integer zero is promoted to real type.
Bootstrapped and regression tested with --enable-languages=all for revision 120588 on i686-pc-gnu-linux.
2007-01-14 Andrew Pinski <pinskia@gmail.com> Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c/21438 * gcc/c-typeck.c (build_binary_op): Don't give division by zero warning if integer zero is promoted to REAL_TYPE.
testsuite: 2007-01-14 Andrew Pinski <pinskia@gmail.com> Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c/21438 * gcc.dg/Wdiv-by-zero.c: New.
Attachment:
wdivbyzero.diff
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |