I've been touching upon this before, I'm now wondering whether we can make
an exact documented specification of how extern ctypedefs can work (if
there is already then I apologize..).

Proposal:

- It is *not* necesarry that the size (long/short or float/double/long
double) matches with the real type in C
- However it *is* required that "unsigned" vs "signed" is correctly
declared, and that "int" vs. "float" is correctly declared. (Failing to do
this leads to undefined behaviour for now, but a module-loading-time
exception could be arranged for.)

Furthermore, it is recommended (just to have a guideline somewhere) to
only use the types "int", "unsigned int" and "float" in extern ctypedefs.

(The new thing here is relying on unsigned vs. signed, which I want to use
for dropping support for negative buffer indexing in situations where
there can be no negative indices (I'm sure gcc could do it for me but it
helps not confusing the users too)).

Dag Sverre

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to