This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Should we make "implicit declaration of function" a mandatorywarning?
- To: Zack Weinberg <zackw at stanford dot edu>
- Subject: Re: Should we make "implicit declaration of function" a mandatorywarning?
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Mon, 15 Jan 2001 08:15:29 +0000 (GMT)
- cc: <gcc at gcc dot gnu dot org>
On Sun, 14 Jan 2001, Zack Weinberg wrote:
> which makes quite clear that something's wrong. What do people think
> of promoting the "implicit declaration of function" warning to
> mandatory? These days it is far more likely to be a bug than
> unregenerate K+R code...
>
> Note that implicit declarations were removed from C99.
At least turn the warning on by default for C99 mode (not just pedantic &&
flag_isoc99 as at present). Then it will be on by default when we move to
gnu99 as default mode.
The most likely case these days is actually probably going to be that the
program is a quick hack (otherwise -Wall should be used), and the return
value isn't being used so the programmer doesn't really care.
Perhaps the GCC manual, the bug reporting instructions, and the glibc
manual, should emphasise to use -Wall before reporting that code works
wrongly?
--
Joseph S. Myers
jsm28@cam.ac.uk