Commit 0ee30d9
libbpf: Fix warning in calloc() usage
When compiling libbpf with some compilers, this warning is triggered:
libbpf.c: In function ‘bpf_object__gen_loader’:
libbpf.c:9209:28: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
9209 | gen = calloc(sizeof(*gen), 1);
| ^
libbpf.c:9209:28: note: earlier argument should specify number of elements, later size of each element
Fix this by inverting the calloc() arguments.
Signed-off-by: Matteo Croce <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]1 parent 0768e98 commit 0ee30d9
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9210 | 9210 | | |
9211 | 9211 | | |
9212 | 9212 | | |
9213 | | - | |
| 9213 | + | |
9214 | 9214 | | |
9215 | 9215 | | |
9216 | 9216 | | |
| |||
0 commit comments