This is one way to fix #28600
Recently usage of undeclared functions became an error rather than a warning, in C2x. https://reviews.llvm.org/D122983?id=420290
This change has migrated into the build tools of Ubuntu 23.10 which now causes the USDT tests to fail to compile, see #28600
I think there are various potential fixes:
- Manually declare the functions we use
- Fix imports so that manual declarations aren’t needed
- Revert the new C2X behaviour and don’t error on implicit function declarations
I would have preferred solution 2, but I believe this will require changes to the upstream bcc package. Having played with the imports I can get things working in a standalone C program, using system headers, but when building the program from a python context as we do in the test it uses its own headers (bundled with the python lib) rather than the system ones, and manually importing (some) system headers results in definition mismatches. I also investigated explicitly importing required headers from the package, which use paths like #import </virtual/bcc/bcc_helpers.h>
, but this seems more obtuse and brittle than simply ignoring the warning.
Therefore I think that until the upstream python pacakge fixes their declarations, we should fix this by setting -Wno-error=implicit-function-declaration
for the tracing programs.
cc maflcko 0xB10C