On Thu, 2024-01-18 at 16:53 -0800, Andrii Nakryiko wrote: [...] > yes, it's a slight deviation from what I ended up doing in the kernel, > because I initially didn't know how to deal with arch-specific > definitions of bpf_user_pt_regs_t. But at the last moment I figured > out that __builtin_types_compatible_p and forward declaring structs > works, so I'll do a small follow up to libbpf to match kernel logic > completely Understood, thank you. I didn't know about __builtin_types_compatible_p() before seeing it in your patch. Full 'Other-Builtins' page of GCC doc turned out to be interesting.