This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: strict aliasing: how to swap pointers
- From: John Love-Jensen <eljay at adobe dot com>
- To: Evan Jones <evanj at MIT dot EDU>
- Cc: GCC-help <gcc-help at gcc dot gnu dot org>
- Date: Wed, 30 Apr 2008 08:41:41 -0500
- Subject: Re: strict aliasing: how to swap pointers
Hi Evan,
> What is confusing to me about the strict aliasing warning is that I
> thought GCC must conservatively assume that a void* pointer can point to
> anything, since T* is convertible to void*.
Correct.
> Hence, it seems to me that casting a T** to void** should not result in a
> type-punning warning.
void** is not void*.
HTH,
--Eljay