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

Use `-Werror=undef` when compiling bcc to catch issues when a macro is not defined. #5019

Closed chantra closed 4 weeks ago

chantra commented 4 months ago

A macro which is not defined will default to 0, this can make it challenging to debug issues as the compiler will happily go ahead and treat an undefined macro to 0.

Here is an example case where it caught an issue: https://github.com/bpftrace/bpftrace/pull/2950/commits/a0eefb6491431d90457c38107a7724f4303e8312

chantra commented 4 months ago

cc @yonghong-song as we were discussing this f2f.