This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] Close PR 150: division by zero [take 2]
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Subject: Re: [RFA] Close PR 150: division by zero [take 2]
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Mon, 22 Oct 2001 20:05:11 +0100 (BST)
- cc: <gcc-patches at gcc dot gnu dot org>, Richard Henderson <rth at redhat dot com>
On Mon, 22 Oct 2001, Neil Booth wrote:
> + /* Floating point division by zero is a legitimate way to obtain
> + infinities and NaNs. */
> + if (skip_evaluation == 0 && integer_zerop (op1))
> + warning ("division by zero");
This doesn't test warn_div_by_zero.
> + if (skip_evaluation == 0 && integer_zerop (op1))
> + warning ("division by zero");
> +
Likewise.
> +@item -Wdiv-by-zero
> +@opindex Wdiv-by-zero
> +Warn about compile-time integer division by zero. Floating point division
> +by zero is not warned about, as it can be a legitimate way of obtaining
> +infinities and NaNs.
Above you defaulted this option to on, but here you document it as off by
default and enabled by -Wall (by virtue of its position above the entry
for -Wall that says it enables the above warning options).
--
Joseph S. Myers
jsm28@cam.ac.uk