[Openais] proper fix for warning: dereferencing type-punned pointer will break strict-aliasing rules

Steven Dake sdake at redhat.com
Thu Apr 13 14:46:16 PDT 2006

If you ever see this warning, it must be fixed _without_ typecasts.
Typecasts hide the problem but the c optimizer may still produce code
that doesn't match what one might expect.  This is the reason openais
segfaults on fedora core 5.

I have attached a patch which repairs some of the offending code.  I'm
not convinced we have all the strict aliasing problems addressed, since
-fwarn-strict-aliasing=2 dumps a ton of warnings about type punned

-------------- next part --------------
A non-text attachment was scrubbed...
Name: type-punned-1.patch
Type: text/x-patch
Size: 24097 bytes
Desc: not available
Url : http://lists.linux-foundation.org/pipermail/openais/attachments/20060413/bff13018/type-punned-1-0001.bin

More information about the Openais mailing list