YALF (yet another lint foulup)
Karl Heuer
karl at haddock.ima.isc.com
Sat Jan 7 06:42:23 AEST 1989
In article <9341 at ihlpb.ATT.COM> nevin1 at ihlpb.UUCP (55528-Liber,N.J.) writes:
>In article <379 at lakart.UUCP> dg at lakart.UUCP (David Goodenough) writes:
>>What is in fact needed is ANOTHER function type `notreturning' ...
>
>This really would be messy. How would you describe the functions which
>return some of the time (far more common than never returning)?
With the type that the function has when it does return. The information
"this function sometimes doesn't return" is not particularly useful, so
there's no point in using the language to document it. On the other hand, if
the function never returns, then the type information (usually "void") is
generally useless. There *is* a conceptual difference difference between
"void exit();" and "void free();".
Note that both lint and the code-generator can take advantage of the fact that
a certain function never returns, if only there were a way to tell them.
>What do you do if a function is non-returning and it falls off the bottom?
The same thing that you do with a value-returning function that falls off the
bottom: you fix the bug (with the help of lint, if it can detect it -- which
it usually can).
Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint
More information about the Comp.lang.c
mailing list