You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In brief: The P6 "native" type int is currently not guaranteed to be the
same as an "int" in C, which prevents portably using "int" with
NativeCall to interface to C code which has "int" arguments.
My suggestion:
Officially guarantee that P6 "int" will always match a C "int" on the
current platform. Document that portable code should assume a range of
-32768..32767 (16 bits), which is the minimum required by C99.
This change will allow "int" to be used portably with NativeCall and
DWIM on all platforms.
Alternatively:
Define another "native" type which _is_ guaranteed to be the same as a C
"int", and document it's use with NativeCall.
If this solution is taken, then make the compiler emit an error if "int"
is used in a CStruct or similar constructs, to prevent people from
thinking they are writing portable code.
Relatedly, there should be a native "unsigned" which is guaranteed to
match a C "unsigned", for use with NativeCall.
Migrated from rt.perl.org#132864 (status was 'new')
Searchable as RT132864$
The text was updated successfully, but these errors were encountered: