This is the mail archive of the gcc@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]
Other format: [Raw text]

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 :-)


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