Re: [PATCH] block-sha1/sha1.c: silence compiler complaints by casting void* to uintptr_t
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Aug 15, 2009, 00:44 UTC
- Message-ID
- <5HEgWEs64y4Ty7FnekstRP8Q71pNi_FTweLbMhYWc6zoZBA4jkJqpQ@cipher.nrlssc.navy.mil>
- In-Reply-To
- <alpine.LFD.2.01.0908141714040.3162@localhost.localdomain>
Linus Torvalds wrote:
Show 9 quoted lines
> 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 *").
Yep, that's enough. It produces an identical binary on all platforms except Solaris x86 using SUNWspro compiler.
-brandon