Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site allegra.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!alan From: alan@allegra.UUCP (Alan S. Driscoll) Newsgroups: net.lang.c Subject: Re: Pointer -> Long Conversion Message-ID: <2643@allegra.UUCP> Date: Wed, 25-Jul-84 13:41:59 EDT Article-I.D.: allegra.2643 Posted: Wed Jul 25 13:41:59 1984 Date-Received: Fri, 27-Jul-84 04:48:06 EDT References: <10@ism780b.UUCP>, <3834@fortune.UUCP>, <3481@brl-tgr.ARPA> Organization: AT&T Bell Laboratories, Murray Hill Lines: 18 > This discussion of sign extending pointers when converting to longs > has got me wondering what the Prime C compiler does when extending a > long into a pointer. Pointers are the longest type on this compiler: > 48 bits, while long, int, and unsigned are all 32 bits. This breaks > all programs that assume pointers can be assigned to longs and recovered > unchanged. Only char pointers need more than 32 bits, but the compiler > author decided to make all pointers 48 bits anyway. I'll investigate > this and report back if anyone is interested. If this is the case, then the Prime compiler is just wrong. See section 14.4 of the C Reference Manual, "Explicit pointer conversions." At least one of the integral types must be large enough to hold a pointer. -- Alan S. Driscoll AT&T Bell Laboratories