Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site oscvax.UUCP Path: utzoo!utcs!oscvax!alan From: alan@oscvax.UUCP (Alan Rooks) Newsgroups: net.micro.68k,net.lang.c Subject: Re: Question of Ignorance Message-ID: <355@oscvax.UUCP> Date: Sat, 11-May-85 19:59:03 EDT Article-I.D.: oscvax.355 Posted: Sat May 11 19:59:03 1985 Date-Received: Sun, 12-May-85 02:35:59 EDT References: <198@unccvax.UUCP> Reply-To: alan@oscvax.UUCP (Alan Rooks) Organization: Ontario Science Centre, Toronto Lines: 15 Xref: utcs net.micro.68k:737 net.lang.c:5094 Summary: David Anthony was wondering why Alcyon Corp's C compiler scales constants in: if (ptr == CONSTANT) ... Maybe Alcyon's justification for this is that (they think) it is equivalent to: if (ptr - CONSTANT == 0) ... which is generally true in comparisons, but not with pointers. So when they subtract the constant from the pointer, they have to scale it, as per K&R page 189. The funny thing is, they don't generate code with a subtraction and a compare against zero (and it would be a shame if they did) ... Alan Rooks, Ontario Science Centre