Comment on Passing nothing is surprisingly difficultparentComments−brabel2yI am not entirely sure, but it seems they chose to return a null pointer:https://github.com/ziglang/zig/commit/32e0dfd4f0dab351a024e7...−anonymoushn2yThis is a commit that changes the now-defunct Zig compiler written in C++ to be careful when it calls malloc. So it has nothing to do with the semantics of the Zig language or the compatibility of zero-sized Zig slices with Rust, C, or C++ APIs.
Comments
I am not entirely sure, but it seems they chose to return a null pointer:
https://github.com/ziglang/zig/commit/32e0dfd4f0dab351a024e7...
This is a commit that changes the now-defunct Zig compiler written in C++ to be careful when it calls malloc. So it has nothing to do with the semantics of the Zig language or the compatibility of zero-sized Zig slices with Rust, C, or C++ APIs.