------- Comment #2 from tlesher at digium dot com  2009-11-20 21:44 -------
Created an attachment (id=19069)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19069&action=view)
Two files that each use one of either the 32-bit or 64-bit versions of the
function

Each file in this attachment contains one of either put_unaligned_uint32 or
put_unaligned_uint64.  The 32-bit version compiles with no errors, while the
64-bit version causes the strict aliasing warning.  I've included a simple
Makefile and the base unaligned.h source file, for ease of examination.

I've also confirmed that using the 'may_alias' attribute in the 64-bit version
suppresses the warning, although I think this qualifies as a workaround, not a
fix to the problem.  I'm also not sure how our project leaders would consider
such a workaround, given that the intent behind extra warnings is to make the
code better.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42103

Reply via email to