C problems: Spend time to ensure you are not writing a bug if sizeof(size_t) != sizeof(void*) or spend time to find out if that case exists.
@hsivonen That is Rust-specific. For C[++], use uintptr_t, as I do:
https://github.com/briansmith/ring/commit/8645dd7c1b4228f8d9851f63a0bcb9527f3d4363 …
https://github.com/briansmith/ring/commit/400f5053580881ade84af648717a5602567f0556 …
https://github.com/briansmith/ring/commit/a6ffa1dd51ac5630e2c7855009b7073d77848fd0 …
-
-
@BRIAN_____ But see http://stackoverflow.com/a/1846648 for the non-guarantee. -
@hsivonen One very rarely needs more than that. Lots of ways to get undefined behavior if you try to do anything fancier. -
@hsivonen ... even when they are the same size.
End of conversation
New conversation -
-
-
@hsivonen Note that Rust requires that sizeof(usize) == sizeof(void*). That's a stronger guarantee than C/C++ make. -
@BRIAN_____ That Rust guarantee is why I was interested in whether sizeof(size_t) != sizeof(void*) realistically could happen in C.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.