Orphaned Response
aglew at ccvaxa.UUCP
aglew at ccvaxa.UUCP
Sat Aug 16 02:51:00 AEST 1986
>I was trying to declare "typedef void dead;" so that I could distinguish
>between functions that return nothing (void perror(char *), setbuf(FILE *,
>char *), nullf(void)) from those that don't return (dead exit(int),
>abort(void), longjmp(jmp_buf, int)). Again, it's a small quibble; I'll
>just use #define instead.
>
>Karl W. Z. Heuer (ihnp4!ima!haddock!karl), The Walking Lint
Good point, though - an optimizing compiler could take advantage of
knowledge that a function doesn't return to do better register allocation,
etc. Should this be in the langauge, or is a convention like
if( error_condition ) {
exit(1);
/*NOTREACHED*/
}
enough? (Rhetorical question: obviously, you should specify it at the point
of declaration of such a function, not at the point of use.)
Andy "Krazy" Glew. Gould CSD-Urbana. USEnet: ihnp4!uiucdcs!ccvaxa!aglew
1101 E. University, Urbana, IL 61801 ARPAnet: aglew at gswd-vms
More information about the Comp.lang.c
mailing list