"Ralf W. Grosse-Kunstleve" <rwgk@xxxxxxxxx> writes:
> 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?
There's no such thing as a general solution to a warning (they're
implementation specific), and these "strict aliasing rules" are a C99
thing, and C++ is based on C89 (or C90, I forget which), and the code
above does the so it's hard to say what should be done.
C++-sig mailing list