[Cython] Status

John Skaller2 skaller at internode.on.net
Sat Feb 1 10:45:21 EST 2020


>> 
>> 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.
> 
> As stated before, the C compiler will see the correct definition of the
> types in the header files. And the generated C code will use the same type
> names that the user had in their source code. "int64_t" will not magically
> become "int" there.

Ah. Ok, I get it now. Thanks. The “int” is just telling Cython the type has
the same operations as “int”, i.e. +, - *, / etc. Like I said, a poor mans 
version of a “type class”. But, the compiler emits the symbols the 
user wrote when required.

—
John Skaller
skaller at internode.on.net







More information about the cython-devel mailing list