This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Feature ideas
- From: dewar at gnat dot com (Robert Dewar)
- To: fjh at cs dot mu dot OZ dot AU, tilps at hotmail dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 8 Nov 2002 09:00:34 -0500 (EST)
- Subject: Re: Feature ideas
> We have implemented a warning which is similar to this in the Mercury
> compiler, and it has proved useful. It is enabled by default and there
> is no way to turn it off. It doesn't trigger very often, but when it
> does, it invariably indicates a bug. I suspect it is most useful to
> novice programmers who are more likely to make mistakes of this kind.
GNAT also has a warning like this. In fact experienced programmers can
sometimes make this mistake, especially when writing something like
function "+" to redefine the normal plus, and then forgetting in the
body that the use of a+b may be a recursive call :-)