Mail Archives: djgpp/1997/07/02/10:48:35
On Tue, 1 Jul 1997, Pauli Saksa wrote:
> here's the source:
>
> #include <stdio.h>
> void main(short argc)
First problem: main MUST ALWAYS RETURN AN int! Second problem the first
argument to main() is an int not a short! Third, in general argc is
pretty useless without argv so... main should be:
int main( int argc, char **argv )
> {
> printf("argc: %d", argc);
> return;
Last problem, since the linker expects main to return an int your return
MUST return something:
return 0;
> }
>
> and here's the compiler's messages:
>
> In function `int main(...)':
> warning: `return' with no value, in function returning non-void
Art S. Kagel, kagel AT bloomberg DOT com
- Raw text -