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
NativeCall does not complain when a CPointer has some internal structure. For instance
class p_timespec is repr('CPointer') {
has uint32 $.tv_sec;
has long $.tv_nanosecs;
}
Expected Behavior
CPointers shouldn't have any internal structure, and CStructs are actually pointers to that. So it should probably issue some helpful hint that what you're looking for is actually CStruct.
Actual Behavior
You can use it alright, it coredumps without any error mesage.
Steps to Reproduce
Run this
use v6;
use NativeCall;
class p_timespec is repr('CPointer') {
has uint32 $.tv_sec;
has long $.tv_nanosecs;
}
sub clock_gettime(uint32 $clock-id, p_timespec $tspec --> uint32) is native(Str) { * };
my p_timespec $this-time .=new;
my $result = clock_gettime( 0, $this-time);
say "$result, $this-time";
The Problem
NativeCall does not complain when a CPointer has some internal structure. For instance
Expected Behavior
CPointers shouldn't have any internal structure, and CStructs are actually pointers to that. So it should probably issue some helpful hint that what you're looking for is actually CStruct.
Actual Behavior
You can use it alright, it coredumps without any error mesage.
Steps to Reproduce
Run this
Result:
Environment
I'm using perl6 2018.03 in Ubuntu 14.04.
The text was updated successfully, but these errors were encountered: