Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site lanl-a.UUCP Path: utzoo!linus!decvax!genrad!wjh12!harvard!seismo!cmcl2!lanl-a!dmk From: dmk@lanl-a.UUCP Newsgroups: net.lang.c Subject: Re: pointer -> long conversion Message-ID: <10216@lanl-a.UUCP> Date: Tue, 10-Jul-84 16:08:55 EDT Article-I.D.: lanl-a.10216 Posted: Tue Jul 10 16:08:55 1984 Date-Received: Thu, 12-Jul-84 01:22:33 EDT References: <831@bbncca.ARPA> Organization: Los Alamos National Laboratory Lines: 24 [] You should be able to get both types of conversion by saying either anytype *x; long i; i = (long)((int) x); /* giving sign extension, or */ i = (long)((unsigned) x); /* no sign extension */ but I'm not sure which one is better to use as the default when you say, i = (long)x; -- it depends on whether you think of an address as just a token (unsigned) or an integer (signed). Maybe it's best to just do whatever is the most natural for the machine involved and if the user needs to force it one way or the other then let him use a double typecast as above. David Keaton Los Alamos National Laboratory ucbvax!lbl-csam!lanl-a!dmk dmk@lanl.arpa