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]

Re: [RFA] Close PR 150: division by zero [take 2]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]