From: Linus Torvalds Date: Sat, 15 Aug 2009 00:19:32 GMT Subject: Re: [PATCH] block-sha1/sha1.c: silence compiler complaints by casting void* to uintptr_t Message-ID: In-Reply-To: On Sat, 15 Aug 2009, Johannes Schindelin wrote: > > I am confused. Is sizeof(*(uintptr_t)NULL) not larger than 1 You can't do that. "uintptr_t" isn't actually a pointer. It's just a unsigned integer value large enough to contain a pointer. So it's _not_ a "pointer to uint". It's "uint that can contain all the bits of a poitner". > and as a consequence ((uintptr_t)p)+1 not different from ((void *)p)+1? No, they're the same. That said, I suspect it might as well be cast to "const char *", and then hopefully you only need one cast. So maybe it could be written as data = (const char *) data + len; instead, and avoid the second cast (because the assignment should be ok, since it's assigning back to a "const void *"). Linus