iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.36k stars 3.86k forks source link

fatal error: -Werror=sign-compare with lastest libbpf-tools #5022

Open michael-chuh opened 4 months ago

michael-chuh commented 4 months ago

https://github.com/iovisor/bcc/pull/4975 adds -Werror to cflags, then I get sign-compare erros below

bpf.c: In function ‘alloc_zero_tailing_info’:
bpf.c:219:23: error: comparison of integer expressions of different signedness: ‘int’ and ‘__u32’ {aka ‘unsigned int’} [-Werror=sign-compare]
  219 |         for (i = 0; i < cnt; i++) {
      |                       ^
cc1: all warnings being treated as errors

lot's of code with similar issues are exist in libbpf, to fix this error from source code seems a hard work. is there any advice about this?