functions that don't return

Chris Torek chris at umcp-cs.UUCP
Wed Oct 1 15:14:01 AEST 1986


In article <584 at hadron.UUCP> jsdy at hadron.UUCP (Joseph S. D. Yao) writes:
>Using 'return' from main() is the preferred way to exit according
>to System V lint (which complains otherwise). ...
>but comments on s5lint's and others' mental models welcome.

Someone at Sun must have had a different model indeed, for alas,
in at least one major release, their startup code amounts to this:

	push argc, argv, envp
	call main
	push 0
	call exit

This means that

    main( ... ) ... return (EX_USAGE); ...

will return not exit code 64, but rather code 0 (success).
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1516)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at mimsy.umd.edu



More information about the Comp.lang.c mailing list