Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rtp47.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!harvard!talcott!panda!genrad!decvax!mcnc!rti-sel!rtp47!throopw From: throopw@rtp47.UUCP (Wayne Throop) Newsgroups: net.micro.68k,net.lang.c Subject: Re: Question of Ignorance Message-ID: <36@rtp47.UUCP> Date: Mon, 13-May-85 13:27:58 EDT Article-I.D.: rtp47.36 Posted: Mon May 13 13:27:58 1985 Date-Received: Thu, 16-May-85 07:10:29 EDT References: <198@unccvax.UUCP> <1427@bbncca.ARPA> <5590@utzoo.UUCP> Reply-To: throopw@vm.UUCP (PUT YOUR NAME HERE) Organization: Data General, RTP, NC Lines: 18 Xref: linus net.micro.68k:700 net.lang.c:4705 In article <5590@utzoo.UUCP> henry@utzoo.UUCP (Henry Spencer) writes: >> ... 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. I'm not sure what ANSI C says about pointers fitting into longs, but I don't think there is any guarantee there either. If there IS such a guarantee, It doesn't seem like a good idea, since I know of machines upon which pointers don't even fit in longs. Of course, pointers would have a better *chance* of fitting into a long :-). -- Wayne Throop at Data General, RTP, NC !mcnc!rti-sel!rtp47!throopw