[issue14249] unicodeobject.c: aliasing warnings

STINNER Victor report at bugs.python.org
Tue Mar 20 01:30:51 CET 2012


STINNER Victor <victor.stinner at gmail.com> added the comment:

Attached patch uses an union to make the compiler warning quiet. It should not speed up Python because the function already ensures that the pointer is aligned to the size of a long. It may slow down the function, I don't know gcc enough to guess exactly the impact on performances.

An alternative is to use __attribute__((__may_alias__)), a GCC specific attribute. I don't know the impact on performances of this attribute.

----------
keywords: +patch
nosy: +pitrou
Added file: http://bugs.python.org/file24953/utf16_decoder_union.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14249>
_______________________________________


More information about the Python-bugs-list mailing list