[RFA] Close PR 150: division by zero

Joseph S. Myers jsm28@cam.ac.uk
Sun Oct 21 23:24:00 GMT 2001


On Mon, 22 Oct 2001, Neil Booth wrote:

> I can easily add a -W option if you like, say -W[no-]div-by-zero.  I
> prefer to avoid a proliferation of options, though.  How about using
> it iff -Wall rather than having an extra option?  I'll scrap the
> floating point warning.

Since -Wall is just a collection of other options, putting it in -Wall
doesn't work without also adding the -Wdiv-by-zero option.

> > What does it do for divisions in non-executed code?  (Clearly, (FOO == 0 ?
> > x : y / FOO) should not receive a warning.)  The testcase needs to cover
> > this.
> 
> Hmm, that's not covered.  Any hints on how to get that right?

At least for C, using skip_evaluation.

-- 
Joseph S. Myers
jsm28@cam.ac.uk



More information about the Gcc-patches mailing list