Avoid -Werror=empty-body errors from runtime/linux/uprobes-inode.c
Newer linux kernel compiles are being built with -Werror=empty-body.
For some modules generated runtime/linux/uprobes-inode.c is pulled in
and will get error messages like the following:
In file included from /tmp/stapGIM4O9/stap_ded21c54fce18c6570a8930d823aca3a_10928_src.c:2439:
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/uprobes-inode.c: In function 'stapiu_change_semaphore_plus':
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/uprobes-inode.c:795:5: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
795 | ; // already unlocked
| ^
cc1: all warnings being treated as errors
Added "{}" in the appropriate location to indicate to the compiler
Avoid -Werror=old-style-declaration for stap_probes array in generated kernel modules
With newer linux kernels additional compilers checks are being done
and will get error messages like the following for the generated
module:
/tmp/stapuundLy/stap_2755fca707746de04395c85872aae4b8_1753_src.c:111:1: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration]
111 | } static stap_probes[];
| ^
cc1: all warnings being treated as errors
Tweaked the code generation in translate.cxx to output the static
stap_probes array in a form that is agreeable to newer kernel builds.
Avoid -Werror=empty-body errors from runtime/linux/debug.h macros
When attempting to run the testsuite the sanity.exp test fails
due to the following -Werror=empty-body errors:
/home/wcohen/systemtap_write/install/share/systemtap/runtime/transport/relay_v2.c: In function '__stp_relay_wakeup_timer':
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/debug.h:47:36: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
47 | #define dbug_trans(level, args...) ;
| ^
/home/wcohen/systemtap_write/install/share/systemtap/runtime/transport/relay_v2.c:195:17: note: in expansion of macro 'dbug_trans'
/home/wcohen/systemtap_write/install/share/systemtap/runtime/transport/symbols.c: In function '_stp_set_stext':
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/debug.h:103:34: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
103 | #define dbug_sym(level, args...) ;
| ^
/home/wcohen/systemtap_write/install/share/systemtap/runtime/transport/symbols.c:44:17: note: in expansion of macro 'dbug_sym'