exit();

John J. Rushford Jr jjr at rushpc
Wed Apr 3 01:37:26 AEST 1991


In article <1991Mar30.155011.767 at rodan.acs.syr.edu> jkchan at lynx.cat.syr.edu (J. K. Chan) writes:
>    exit value declared inconsistently	llib-lc(232)  ::  t.c(8)

In article <1991Mar31.6943 at segue.segue.com> jim at segue.segue.com (Jim Balter) writes:

> How is exit declared in stdlib.h and in llib-lc on your system?  They should
> both be declared as returning void.  I suspect that your stdlib.h doesn't
> declare exit at all, which would explain why the message refers to t.c(8),
> which would be an implicit declaration of  int exit();  in the absense of
> a declaration in stdlib.h.

I've always used the following and avoid the lint complaint:

#include	<stdio.h>

void exit();  /* exit returns type void */

main()
{
	program_stuff();
	exit(1);
	exit(2);
	exit(3);
	exit(etc);
}
-- 

J. Rushford
-----------
Westminster, Colorado.



More information about the Comp.lang.c mailing list