Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!iuvax!bobmon From: bobmon@iuvax.cs.indiana.edu (RAMontante) Newsgroups: comp.lang.c Subject: Re: (* func)(fred, bert) Message-ID: <30324@iuvax.cs.indiana.edu> Date: 27 Nov 89 18:21:28 GMT Organization: malkaryotic Lines: 24 excerpted from jon@jonlab.UUCP (Jon H. LaBadie) <824@jonlab.UUCP> : -I encountered one instance where "declaring" main to be other than int -caused severe problems. The file containg main was organized as follows: - struct foo { - various members; - } - - main() - { - ... - } -Note the missing semicolon, failing to terminate the declaration of -struct foo, and thus serving to define main as a function returning a -struct foo. Sounds like an argument for explicitly stating the return type (of main() and all other functions) --- the missing paren would've tripped a syntax error. Of course that would tempt you to declare a type that reflected what you expect main() to return, like "void" ... Maybe stdlib.h or something should've included a standard prototype: int main(int, char **, char **); to clean up stuff like this.