Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site bbnccv.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!harvard!bbnccv!keesan From: keesan@bbnccv.UUCP (Morris M. Keesan) Newsgroups: net.micro.68k,net.lang.c Subject: Re: Question of Ignorance Message-ID: <480@bbnccv.UUCP> Date: Wed, 15-May-85 10:45:31 EDT Article-I.D.: bbnccv.480 Posted: Wed May 15 10:45:31 1985 Date-Received: Thu, 16-May-85 21:44:54 EDT References: <198@unccvax.UUCP>, <1427@bbncca.ARPA> <5590@utzoo.UUCP> Organization: Bolt Beranek and Newman, Cambridge, MA Lines: 20 Xref: linus net.micro.68k:706 net.lang.c:4717 -------------------------------------------------------------------- > > ... I recommend using one of the two constructs > > > > ( longptr == (long *)32 ) > > or ( (int)longptr == 32 ) > > > > which are guaranteed to do what you want ... > > Argh, WRONG!! Turn that "(int)" into "(long)" and I might agree. You > have no guarantees that an int is long enough to hold a pointer. Nor do you have any guarantees that a long is enough to hold a pointer. I was thinking that the (int) cast was sufficient because 32 is an int, but on reflection I see that it might truncate longptr and give a result of TRUE if the low-order int of longptr were 32. I hereby retract my recommendation of the second form, but stand by the first, which was my preference anyway. --------------------------------- Morris M. Keesan {decvax,ihnp4,etc.}!bbncca!keesan keesan@bbn-unix.ARPA