[Numpy-discussion] [RFC] complex functions in npymath

David Cournapeau david@ar.media.kyoto-u.ac...
Fri Oct 30 04:57:12 CDT 2009


Pauli Virtanen wrote:
>
> I can probably take a shot at this.
>   

Cool.

> Correct me if I'm wrong, but I think the problem is that for
>
> 	typedef struct foo foo_t;
> 	foo_t bar();
>   

You're right, I was thinking about alignment issues myself - that's why
I mentioned npy_complex and double[2] being equivalent, as defining
complex with a struct does not guarantee this.

> different compilers may put the return value of bar() to a different 
> place (registers vs. memory). If we put those functions in a library, and 
> switch compilers, I think the behavior is undefined as there seems to be 
> no standard.
>   

Is this a problem in practice ? If two compilers differ in this,
wouldn't they have incompatible ABI ?

David


More information about the NumPy-Discussion mailing list