This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: dead code elim && div-by-0 warnings
- To: Andrew Morton <andrewm at uow dot edu dot au>
- Subject: Re: dead code elim && div-by-0 warnings
- From: Alexandre Oliva <aoliva at cygnus dot com>
- Date: 28 Mar 2000 17:23:05 -0300
- Cc: gcc-bugs at gcc dot gnu dot org
- Organization: Cygnus Solutions, a Red Hat Company
- References: <38E00A33.50564DDA@uow.edu.au>
On Mar 27, 2000, Andrew Morton <andrewm@uow.edu.au> wrote:
> int foo(int i) { return i / 0; }
> I'd suggest that a warning be generated for this. (Bearing in mind that
> '0' could be the result of a complex macro expansion and not obvious).
Actually, if it often the case that, when it is the result of a
complex macro expansion, it is protected by an `if (... != 0)', so the
warning would often be just an annoyance. But, of course, if it is
not enabled by default, nor with -W -Wall, but only with
-Wdivide-by-zero, for example, it could be useful. Patches are
welcome :-)
--
Alexandre Oliva Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org} Write to mailing lists, not to me