Mail Archives: djgpp/1998/10/08/13:55:46
On 6 Oct 1998, Uhfgood wrote:
> Hey... consider the following function :
>
> jerk( )
> {
> printf("Bill is a jerk.\n");
> }
>
> How come I don't get any prototyping warnings or errors when
> I compile this? It compiles fine... no warnings or nothin'
Do you mean that you expect to get a warning about implicit
declaration of `printf' (since you didn't #include <stdio.h>) or
that you expect to get a warning about your function being
defined without a prototype?
AFAIK gcc never warns about defining a function without first
giving a prototype. It does warn about calling an unprototyped
function before its declaration, if you turn on (almost) all
warnings by passing `-Wall'. It will also warn that you didn't
specify a return type, and so `int' is assumed, and it will then
warn that you didn't return a value.
--
george DOT foot AT merton DOT oxford DOT ac DOT uk
xu do tavla fo la lojban -- http://xiron.pc.helsinki.fi/lojban/lojban.html
- Raw text -