Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!Portia!jrll From: jrll@Portia.Stanford.EDU (john ralls) Newsgroups: comp.lang.c Subject: Re: Beware the implicit function declaration! Summary: He did declare them! Message-ID: <4171@Portia.Stanford.EDU> Date: 20 Nov 88 05:09:42 GMT References: <4264@bnrmtv.UUCP> <8937@smoke.BRL.MIL> Reply-To: jrll@Portia.stanford.edu (john ralls) Organization: Stanford University Lines: 11 Unless I misunderstand completely the rules on declaration, simply by defining the functions before main(), they were also declared. C defaults to an int return value, so as long as he didn't try to assign the return value to something else, he got no warnings. Incidentally, since these functions niether take nor return any value, they should be prototyped or declared as void a(void). This can be done in the body of main() iff main() is the first function in the file or is in another file (in which case it should be extern void a (void)) (this is prototyping); otherwise the start of the definition should be the declaration as well. John