YALF (yet another lint foulup)

Alan J Rosenthal flaps at dgp.toronto.edu
Sun Jan 8 13:01:11 AEST 1989


nevin1 at ihlpb.UUCP (55528-Liber,N.J.) writes:
>What do you do if a function is non-returning and it falls off the
>bottom?  Never returning is a hard property to check in C.

You can't check it beforehand, but you can compile in an fprintf to stderr and
an exit instead of the stack popping sequence.  It's just like array bounds
checking in Pascal.  Sometimes you can check it at compile time, sometimes the
check is delayed until run time.

Of course, this check wouldn't probably be necessary to meet the definition
of C.  Giving an error message for explicit return statements would be
sufficient.

ajr

--
"The goto statement has been the focus of much of this controversy."
	    -- Aho & Ullman, Principles of Compiler Design, A-W 1977, page 54.




More information about the Comp.lang.c mailing list