Subject: Re: new sysctl(KERN_PROC, ...) interface (was: sysinfo(2))
To: Chris G. Demetriou <cgd@netbsd.org>
From: Eduardo Horvath <eeh@turbolinux.com>
List: tech-kern
Date: 04/17/2000 15:15:07
On 17 Apr 2000, Chris G. Demetriou wrote:

> Darren Reed <darrenr@reed.wattle.id.au> writes:
> > > > 	#define PTRTOINT64(foo) ((u_int64_t)(long)(foo))
> > 
> > I missed the original, but we should use intptr_t, not long here.
> > It is architecture size dependant, of course.  IMHO, we use long
> > too often where we should be using intptr_t.
> 
> Yes.  Of course, unless i'm mistaken, 'intptr_t' is a relative
> newcomer, and most people haven't been educated as to the joys of its
> use.

I'm not certain it helps much in this case.  How do you determine whether
to use intptr_t or uintptr_t when extending a 32-bit address to a 64-bit
field?  Does C9x address this?

Eduardo Horvath