[C++-sig] boost/python 1.33.1 breaks aliasing rules

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Sat Jun 24 07:44:08 CEST 2006


Coincidentally, on Python-Dev Scott David Daniels just suggested this trick to
get rid of the "will break strict-aliasing rules" warnings:

>     PyObject_CallFunction((PyObject*) (void *) &PyRange_Type,
>                           "lll", start, start+len*step, step)

I.e. the trick is to insert an intermediate (void *) cast. It works with g++
4.1.0 at least. Could this be a general solution?


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Cplusplus-sig mailing list