Re: [Cython] Memory views: dereferencing pointer does break strict-aliasing rules

2013-10-11 Thread Robert Bradshaw
On Fri, Oct 11, 2013 at 10:46 AM, Stefan Behnel wrote: > Robert Bradshaw, 11.10.2013 19:10: >> Python and Cython in >> general breaks pointer aliasing as objects are simultaneously generic >> PyObject* and PyListObject*, PyDictObject*, etc. As the set of >> possible types is large and open, union

Re: [Cython] Memory views: dereferencing pointer does break strict-aliasing rules

2013-10-11 Thread Stefan Behnel
Robert Bradshaw, 11.10.2013 19:10: > Python and Cython in > general breaks pointer aliasing as objects are simultaneously generic > PyObject* and PyListObject*, PyDictObject*, etc. As the set of > possible types is large and open, unions won't work. This is how > object oriented programming (with

Re: [Cython] Memory views: dereferencing pointer does break strict-aliasing rules

2013-10-11 Thread Robert Bradshaw
On Fri, Oct 11, 2013 at 2:15 AM, David Cournapeau wrote: > > On Tue, Jul 2, 2013 at 5:07 PM, Robert Bradshaw wrote: >> >> On Tue, Jul 2, 2013 at 4:54 AM, Yury V. Zaytsev wrote: >> > Hi, >> > >> > The simplest possible program using memory views compiles with a large >> > number of warnings for m

Re: [Cython] Memory views: dereferencing pointer does break strict-aliasing rules

2013-10-11 Thread David Cournapeau
On Tue, Jul 2, 2013 at 5:07 PM, Robert Bradshaw wrote: > On Tue, Jul 2, 2013 at 4:54 AM, Yury V. Zaytsev wrote: > > Hi, > > > > The simplest possible program using memory views compiles with a large > > number of warnings for me, even for a rather outdated version of gcc: > > > > def hello(i

Re: [Cython] Memory views: dereferencing pointer does break strict-aliasing rules

2013-07-04 Thread Yury V. Zaytsev
Hi Robert, On Tue, 2013-07-02 at 09:07 -0700, Robert Bradshaw wrote: > > You should compile with -fno-strict-aliasing--if you were using > distutils rather than gcc directly it should add the all necessary > flags for you. Indeed, I'm using autotools to compile the module, so now I've added the

Re: [Cython] Memory views: dereferencing pointer does break strict-aliasing rules

2013-07-02 Thread Robert Bradshaw
On Tue, Jul 2, 2013 at 4:54 AM, Yury V. Zaytsev wrote: > Hi, > > The simplest possible program using memory views compiles with a large > number of warnings for me, even for a rather outdated version of gcc: > > def hello(int [:] a): > print(a, "world") > > If I translate it with the l