Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 exptools; site whuxl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!mike From: mike@whuxl.UUCP (BALDWIN) Newsgroups: net.lang.c Subject: Re: soundex algorithm wanted Message-ID: <1244@whuxl.UUCP> Date: Thu, 11-Sep-86 13:43:27 EDT Article-I.D.: whuxl.1244 Posted: Thu Sep 11 13:43:27 1986 Date-Received: Fri, 12-Sep-86 07:34:24 EDT References: <27@houligan.UUCP> <672@bnrmtv.UUCP> <1239@whuxl.UUCP> <3266@umcp-cs.UUCP> Organization: AT&T Bell Laboratories, Whippany Lines: 19 > In article <1239@whuxl.UUCP> mike@whuxl.UUCP (BALDWIN) writes: > > register char c, lc, prev = '0'; > > All the compilers I have used ignore the `register' on `register > char' declarations. In any case, an `int' will hold everything > that will fit in a `char', and is (usually) the `natural word size' > of the machine. 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? On a 3B20, `register char c' is indeed put in a register, and generates exactly the same code as `register int c', except the instruction is `cmpb' instead of `cmpw'. 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. -- Michael Baldwin (not the opinions of) AT&T Bell Laboratories {at&t}!whuxl!mike