Re: [PATCH] libbpf bpf_helpers: Use __builtin_offsetof for offsetof if available

2020-07-18 Thread Andrii Nakryiko
On Fri, Jul 17, 2020 at 12:24 AM Ian Rogers wrote: > > The non-builtin route for offsetof has a dependency on size_t from > stdlib.h/stdint.h that is undeclared and may break targets. > The offsetof macro in bpf_helpers may disable the same macro in other > headers that have a #ifdef offsetof guar

Re: [PATCH] libbpf bpf_helpers: Use __builtin_offsetof for offsetof if available

2020-07-17 Thread Yonghong Song
On 7/17/20 12:23 AM, Ian Rogers wrote: The non-builtin route for offsetof has a dependency on size_t from stdlib.h/stdint.h that is undeclared and may break targets. The offsetof macro in bpf_helpers may disable the same macro in other headers that have a #ifdef offsetof guard. Rather than add

[PATCH] libbpf bpf_helpers: Use __builtin_offsetof for offsetof if available

2020-07-17 Thread Ian Rogers
The non-builtin route for offsetof has a dependency on size_t from stdlib.h/stdint.h that is undeclared and may break targets. The offsetof macro in bpf_helpers may disable the same macro in other headers that have a #ifdef offsetof guard. Rather than add additional dependencies improve the offseto