In current gcc trunk: warning: dereferencing type-punned pointer will break strict-aliasing rules
Giovanni Bajo
giovannibajo@libero.it
Mon Jun 13 19:20:00 GMT 2005
Nathan Sidwell <nathan@codesourcery.com> wrote:
> Christian Joensson wrote:
>> I'd just like to ask if this is noticed:
>>
>> /usr/local/src/trunk/gcc/gcc/unwind-dw2.c:324: warning: dereferencing
>> type-punned pointer will break strict-aliasing rules
>> /usr/local/src/trunk/gcc/gcc/unwind-dw2.c:789: warning: dereferencing
>> type-punned pointer will break strict-aliasing rules
>> /usr/local/src/trunk/gcc/gcc/unwind-dw2.c:1005: warning:
>> dereferencing type-punned pointer will break strict-aliasing rules
>> /usr/local/src/trunk/gcc/gcc/unwind-dw2-fde.c:1024: warning:
>> dereferencing type-punned pointer will break strict-aliasing rules
>> /usr/local/src/trunk/gcc/gcc/unwind-dw2-fde-glibc.c:393: warning:
>> dereferencing type-punned pointer will break strict-aliasing rules
>
> I had not noticed this, but looking at the first one it must have
> been caused by my patch to the type punning warning. It also appears
> to be a correct warning, in that we are breaking aliasing.
I see also these in my builds:
../../../gcc/libmudflap/mf-runtime.c:320: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../gcc/libmudflap/mf-runtime.c:323: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../gcc/libmudflap/mf-runtime.c:326: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../gcc/libmudflap/mf-runtime.c:329: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../gcc/libmudflap/mf-runtime.c:333: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../gcc/libmudflap/mf-runtime.c:336: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../gcc/libmudflap/mf-runtime.c:339: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../gcc/libmudflap/mf-runtime.c:342: warning: dereferencing type-punned
pointer will break strict-aliasing rules
The code is accessing a variable of enum type through an unsigned pointer.
Giovanni Bajo
More information about the Gcc
mailing list