strict aliasing: how to swap pointers

John Love-Jensen eljay@adobe.com
Wed Apr 30 14:49:00 GMT 2008


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



More information about the Gcc-help mailing list