Mail Archives: djgpp/1997/12/28/04:46:41
On Fri, 26 Dec 1997, Nate Eldredge wrote:
> At 01:31 12/26/1997 PST, Noam Rotem wrote:
>
> >When I'm using the -Wall switch, I get also the warning about
> >main, defaulting to 'int'...
>
> Strangely, I can't get the warnings myself. Compiling this program:
>
> #include <stdio.h>
> void main(void) { printf("Hello, world"); }
>
> yields no warnings, even with `-Wall' and/or `-W'.
The warning is issued when you say "main(void)", not "void main(void)".
The latter is perfectly legal, even though it's looking for trouble
and against ANSI C rules.
- Raw text -