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

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Mon Dec 5 17:51:24 CET 2005


--- Philipp Thomas <pth at suse.de> wrote:

> * David Abrahams (dave at boost-consulting.com) [20051201 20:06]:
> 
> > >     return (detail::new_reference)PyObject_CallFunction(
> > >         (PyObject*)&PyString_Type, "(O)",
> > >         arg_.ptr());
> > >
> 
> > I'm pretty sure this warning is bogus
> 
> It's not. AFAICS, PyObject and PyString_Type aren't related in any way. So
> casting &PyString_Type to 'PyObject *' breaks aliasing rules and
> dereferencing the type-punned pointer does break strict-aliasing analysis.

I don't think we can do anything about this in boost. It looks to me like you
are effectively asking for a re-write of C Python. Since there is no
inheritance in C you are probably suggesting C++ Python, a.k.a. Python 4000.

Cheers,
        Ralf



		
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 




More information about the Cplusplus-sig mailing list