[libc-commits] [libc] [libc] Export the RPC interface from `libc` (PR #71432)

Jon Chesterfield via libc-commits libc-commits at lists.llvm.org
Wed Mar 13 15:26:39 PDT 2024


https://github.com/JonChesterfield requested changes to this pull request.

The reinterpret_casts I cautioned against in November are still here, this time with clear cut undefined behaviour.

```
rpc::Client::Port *port = reinterpret_cast<rpc::Client::Port *>(handle);
port-> bang
```

Handle is 32 bytes. It's not an instance of port. Totally invalid C++, you need to handle aliasing with far more paranoia than this to be correct. Even if you're going with "UB is fine, clang isn't currently breaking me", that's a misaligned load and I doubt GPUs support that gracefully.

https://github.com/llvm/llvm-project/pull/71432


More information about the libc-commits mailing list