Re: [PATCH] block-sha1/sha1.c: silence compiler complaints by casting void* to uintptr_t
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 15, 2009, 00:08 UTC
- Message-ID
- <alpine.DEB.1.00.0908150207270.8306@pacific.mpi-cbg.de>
- In-Reply-To
- <_-0l9qI_nKm-VVtKlL5hzen4bhcyRmiZ1z4jSmKK1LwECXueziRDzSTyacEehOkoqsfYIaEUlds@cipher.nrlssc.navy.mil>
Hi,
On Fri, 14 Aug 2009, Brandon Casey wrote:
> Some compilers produce errors when arithmetic is attempted on pointers to > void. So cast to uintptr_t when performing arithmetic on void pointers.
I am confused. Is sizeof(*(uintptr_t)NULL) not larger than 1, and as a consequence ((uintptr_t)p)+1 not different from ((void *)p)+1?
Ciao, Dscho