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

Jon Chesterfield via libc-commits libc-commits at lists.llvm.org
Thu Nov 9 10:01:57 PST 2023


https://github.com/JonChesterfield commented:

Function pointers are a bad thing. We should be exporting the C++ interface as C++. not doing this dance through a C shim in exchange for widening the scope for programmer error and performance cost, plus further rolling the die with the compiler correctness.

The implementation has reinterpret cast all over the place and shouldn't. Declare the port as something like
struct port
{
  union {
  uint64_t d;
  void* p;
};
};

or just as struct {uint64_t}, and generally if people decide to read or write that integer themselves they get to keep all the pieces.

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


More information about the libc-commits mailing list