identifying c++ aliasing violations

Philipp Thomas philipp.thomas@t-link.de
Tue Dec 13 00:40:00 GMT 2005


On Sun,  4 Dec 2005 20:07:33 -0500 (EST), Jack Howarth wrote:

>swigpy.cc: In function 'int SWIGPY_Python_ConvertPtr(PyObject*, void**, swig_typ
>e_info*, int)':
>swigpy.cc:620: warning: dereferencing type-punned pointer will break strict-alia
>sing rules

My recent encounters with python (in my case libboost_python) have shown
me that code that uses the Python interface has to use
no-strict-aliasing. Even the Python folks decided to use that switch in
2003 for the Python code (written in C).

This is mostly because Python code is riddled with casts to PyObject.

Philipp



More information about the Gcc mailing list