Message info
 
To:python-bugs-list@python.org From:STINNER Victor Subject:[issue14249] unicodeobject.c: aliasing warnings Date:Thu, 05 Apr 2012 21:00:31 +0000
 


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

Ok, benchmarks have spoken, amen. I applied Serhiy Storchaka's patch (version 3). I just replaced expressions in calls to Py_MAX by variables: Py_MAX is a macro and it may have to compute each expression twice. I didn't check if it's more or less efficient. Thanks Serhiy for your contribution! I added your name to Misc/ACKS.

We may change Py_MIN/Py_MAX to something more efficient using typeof():

#define max(a,b) \
({ typeof (a) _a = (a); \
typeof (b) _b = (b); \
_a > _b ? _a : _b; })

I don't know which C compilers support it, but gcc does, at least.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue14249>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40all-mail-archive.com