Re: pointer arithmetics and casts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 26, 2007 at 04:32:47AM +0100, Derek M Jones wrote:
> This is an unsigned type, so the wrap around behavior is defined.
> But do you really want to map a small negative index into a large 
> positive one?
> 
> You probably have to use intptr_t and uintptr_t.
> 
> On the other hand if sizeof(size_t) == sizeof(type_of(tree for i))
> is an implicit cast needed?

It is not; however, on a lot of targets that doesn't really help since
the typical situation will have i smaller than p (any 64bit target with
32bit int).  So the problem of having to allocate a lot of extra nodes
remains...

FWIW, I don't think that asking which of the target's integer types is
suitable is really relevant; assuming that such type exists at all,
we can make it a parameter of target and be done with that (BTW, we
are not guaranteed that there is an integer type capable of holding
a pointer - see 7.18.1.4, it's an optional type).
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux