[Cython] Status
John Skaller2
skaller at internode.on.net
Sat Feb 1 09:38:20 EST 2020
> On 1 Feb 2020, at 20:00, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>
> On 1/02/20 3:29 pm, John Skaller2 wrote:
>> But the all hell breaks loose for pointers. Your hack only
>> works for rvalues.
>
> Yes, using these it's possible for Cython to accept something
> that will later be rejected by the C compiler. It's not perfect,
> but it gets the job done most of the time.
My concern is that the C compiler wont reject it, the program
will corrupt data or crash:
int32_t *x=..; *x = 42;
int64_t *x=..; *x = 42;
The C compiler will overwrite 4 or 8 bytes. Which one matters.
In an rvalue context it probably doesn’t matter, in an lvalue
context it does. But probably this doesn’t happen in Cython.
—
John Skaller
skaller at internode.on.net
More information about the cython-devel
mailing list