Help wanted with C/4.?BSD/VAX register short problem

Arthur David Olson ado at elsie.UUCP
Mon Dec 2 05:29:51 AEST 1985


In article <1016 at munnari.OZ>, kre at munnari.OZ (Robert Elz) writes:
> What follows is a test for correctness of C compilers in this
> area.

The posting is appreciated; however, it doesn't seem to show up whatever
problem it is that convinced the Berkeley folks to ignore the "register"
advice in "register short" (et al.) declarations.  This is the way the
Berkeley folks got rid of register shorts (code from "pcc/local.c",
the trade secret status precludes a more complete posting):

    #ifdef TRUST_REG_CHAR_AND_REG_SHORT
    	if( t==INT || t==UNSIGNED || t==LONG || t==ULONG	/* tbl */
    		|| t==CHAR || t==UCHAR || t==SHORT 		/* tbl */
    		|| t==USHORT || ISPTR(t)) return(1);		/* tbl */
    #else
    	if( t==INT || t==UNSIGNED || t==LONG || t==ULONG	/* wnj */
    		|| ISPTR(t)) return (1);			/* wnj */
    #endif

If I generate a C compiler from the distributed 4.1BSD sources with
TRUST_REG_CHAR_AND_REG_SHORT defined, the generated compiler passes the
"correctness test."  So the question remains:  why did the Berkeley folks
get rid of register shorts?
--
Short is a Randy Newman trademark.
--
	UUCP: ..decvax!seismo!elsie!ado    ARPA: elsie!ado at seismo.ARPA
	DEC, VAX and Elsie are Digital Equipment and Borden trademarks



More information about the Comp.unix.wizards mailing list