On Tue, Oct 3, 2017 at 10:03 AM, Jesper Dangaard Brouer <bro...@redhat.com> wrote: > > > First of all, thank you Craig for working on this. As Alexei says, we > need to improve tools/lib/bpf/libbpf and move towards converting users > of bpf_load.c to this lib instead. > > Comments inlined below. > >> + obj->maps[map_idx].def = *def; > > I'm not too happy/comfortable with this way of copying the memory of > "def" (the type-cased struct bpf_map_def). I guess it works, and is > part of the C-standard(?).
I believe this is a C++-ism. I'm not sure if it was pulled into the C99 standard or if it's just a gcc 'feature' now. I kept it because it was in the initial code, but I'm happy to do an explicit copy for v3 if that looks better.