Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!netcom!hinton From: hinton@netcom.UUCP (Greg Hinton) Newsgroups: comp.lang.c Subject: Re: Turbo C atexit function. Summary: Borland needs to test their sample code! Keywords: Turbo C Message-ID: <1538@netcom.UUCP> Date: 19 Jun 89 17:49:09 GMT References: <166@enuxha.eas.asu.edu> Reply-To: hinton@netcom.UUCP (Greg Hinton) Organization: NetCom Services - Public Access Unix System (408) 997-9175 guest Lines: 29 In article <166@enuxha.eas.asu.edu> hocker@enuxha.eas.asu.edu (Charles C. Hocker) writes: > I am using Turbo C 2.0 and am having trouble getting the >atexit function to work. I typed in the following program from the >Turbo C reference guide and could not get it to work.... >.... > >atexit_t exit_fn1 (void) >.... > >atexit_t exit_fn2 (void) >.... > >main () >{ > /* posting exit_fn1 */ > atexit (exit_fn1); > > /* posting exit_fn2 */ > atexit (exit_fn2); > printf ("Main quitting...\n"); >} > >When the program is compiled the following error messages are given: > Type mismatch in parameter 'func' in call to 'atexit' in function main This example is taken verbatim from pp. 47-48 of the Reference Manual. The bug is in the manual, not the compiler or libraries! Change the type of exit_fn1() & exit_fn2() to void & all will be well!