Subject: Re: __UNCONST(a)
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@NetBSD.ORG>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 07/01/2004 21:41:52
>>> When subtracting pointers they both have to point into the same
>>> array.
>> Isn't it into the same _object_?
> How can a NULL pointer ever point to the same storage object as any
> other non-NULL pointer?
_Into_, not _to_.
{
struct foo { ... int bar; ... int baz; ... };
int *a;
int *b;
struct foo f;
...
a = &f.bar;
b = &f.baz;
Now, is b-a a legal subtraction?
How about if s/int/char/ throughout (char * is special)?
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B