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
I went over tutorial and spotted a few typos (see below).
I think the SHA-1 example shouldn't use the static buffer because it
is not task-safe.
More significantly, the gettimeofday example still uses the wrong
types for time_t and suseconds_t. time_t is usually signed and not
always 64 bit (or the size of a machine word). suseconds_t can be a
32-bit type even on 64-bit machines, and the padding is in the wrong
place on big-endian machines. Not sure if rustc already works on
anything besides i386 and amd64 on GNU libc platforms. But even to
support these two, you need this:
type timeval = {mut tv_sec: c_long, mut tv_usec: c_long};
time_t and suseconds_t are two of the most problematic types for FFI.
It's difficult to find structs in POSIX which are essentially fixed.
struct pollfd appears to be one such type, but the example would have
to be larger.
The text was updated successfully, but these errors were encountered:
Implement some `llvm.x86.sse2.*` intrinsics and add tests
Continuation of rust-lang/miri#2989 with SSE2 intrinsics.
Thankfully, a significant amount of SSE2 functions use `simd_*` intrinsics, which are already implemented in Miri.
celinval
pushed a commit
to celinval/rust-dev
that referenced
this issue
Jun 4, 2024
From Florian Weimer:
I went over tutorial and spotted a few typos (see below).
I think the SHA-1 example shouldn't use the static buffer because it
is not task-safe.
More significantly, the gettimeofday example still uses the wrong
types for time_t and suseconds_t. time_t is usually signed and not
always 64 bit (or the size of a machine word). suseconds_t can be a
32-bit type even on 64-bit machines, and the padding is in the wrong
place on big-endian machines. Not sure if rustc already works on
anything besides i386 and amd64 on GNU libc platforms. But even to
support these two, you need this:
type timeval = {mut tv_sec: c_long, mut tv_usec: c_long};
time_t and suseconds_t are two of the most problematic types for FFI.
It's difficult to find structs in POSIX which are essentially fixed.
struct pollfd appears to be one such type, but the example would have
to be larger.
The text was updated successfully, but these errors were encountered: