Date: Wed, 2 Jul 1997 10:45:44 -0400 (EDT) From: "Art S. Kagel" To: Pauli Saksa Cc: djgpp AT delorie DOT com Subject: Re: problems with void main(...) In-Reply-To: <33B95552.7C88@traditor.fi> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 1 Jul 1997, Pauli Saksa wrote: > here's the source: > > #include > 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