Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!sri-spam!mordor!lll-lcc!pyramid!batcomputer!braner From: braner@batcomputer.UUCP Newsgroups: comp.lang.c Subject: Re: Order of registers Message-ID: <195@batcomputer.tn.cornell.edu> Date: Tue, 17-Feb-87 01:20:28 EST Article-I.D.: batcompu.195 Posted: Tue Feb 17 01:20:28 1987 Date-Received: Thu, 19-Feb-87 06:19:41 EST References: <3950004@nucsrl.UUCP> <83@ucdavis.UUCP> Reply-To: braner@batcomputer.UUCP (braner) Organization: Theory Center, Cornell University, Ithaca NY Lines: 19 Summary: Keep it as in K&R! In article <4141@utcsri.UUCP> flaps@utcsri.UUCP (Alan J Rosenthal) writes: > f(nformal) > int nformal; > { > register int i,n = nformal; >, which is often recommended, wastes an int on all machines. "Wastes an int"??? - nformal is on the stack anyway, so if you use "register" before the '{' the compiler copies it to a register. Therefore the code above is IDENTICAL in effect - but leaves the ORDER of "register" assignments up to the programmer. I support the K&R method of the compiler following the programmer's order until registers are used up. After all, C is supposed to give the programmer as much control of the machine as possible. - Moshe Braner