soundex algorithm wanted

Chris Torek chris at umcp-cs.UUCP
Sun Sep 14 18:51:07 AEST 1986


>In article <3266 at umcp-cs.UUCP> I wrote:
>>All the compilers I have used ignore the `register' on `register
>>char' declarations. ... Is there ever any reason to declare a variable
>>`register char' rather than `register int'?  Are there any extant
>>compilers for which the latter will generate *worse* code?

In article <1244 at whuxl.UUCP> mike at whuxl.UUCP (BALDWIN) writes:
>On a 3B20, `register char c' is indeed put in a register ....
>Of course there's a reason for declaring a variable as char
>instead of int; if it is used as a char, it should be declared char.

I agree, in principle; this is just a part of saying what you mean.
I meant to ask `is there ever any reason, other than saying what
you mean'.  I have, since I discovered that the 4BSD compiler
ignores `register' on `char's, given in to expediency.  I suppose
I was really looking for an excuse to work on the compiler.  Well,
now I have one:  Sun's compiler does indeed generate better code,
in some cases, for `register char's than for `register int's.
-- 
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