Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!ucsfcgl!pett From: pett@socrates.ucsf.edu (Eric Pettersen%CGL) Newsgroups: comp.sys.atari.st Subject: Re: Lattice C compiler bug Message-ID: <10001@cgl.ucsf.edu.ucsfcgl.UUCP> Date: Thu, 8-Jan-87 20:01:32 EST Article-I.D.: cgl.10001 Posted: Thu Jan 8 20:01:32 1987 Date-Received: Fri, 9-Jan-87 01:47:30 EST References: <2330@eagle.ukc.ac.uk> <864@uwmacc.UUCP> Sender: daemon@ucsfcgl.UUCP Reply-To: pett@socrates.ucsf.edu.UUCP (Eric Pettersen) Organization: UCSF Computer Graphics Lab Lines: 25 In article <864@uwmacc.UUCP> oyster@unix.macc.wisc.edu.UUCP (Vicarious Oyster) writes: >In article <2330@eagle.ukc.ac.uk> pc@ukc.ac.uk (R.P.A.Collinson) writes: >> >>The following C bits will generate incorrect code: >> >> char buffer[BUFSIZ]; >> >> register char *pt; >> register n; >> >> /* How many bytes left in the buffer please ? */ >> n = &buffer[BUFSIZ] - pt; >> > Doesn't the declaration "register char *pt;" mean "a pointer to a >register," in fact? Can you tell me what a pointer to a register is? >Supposedly, that kind of (presumably) illegal declaration is ignored, >but I can see where a writer of a <$100 compiler might not handle it >correctly. That's no excuse, of course... >-- No, it means that the pointer's value is kept in a register. Trying to use &pt (the address of a register) would then be illegal. Eric Pettersen UCSF Computer Graphics Lab