From: William Cohen Date: Mon, 3 Jun 2024 19:46:49 +0000 (-0400) Subject: Avoid -Werror=empty-body errors from runtime/linux/uprobes-inode.c X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=1fd6fb4d7101e013e21006da3b77b9723be5b446;p=systemtap.git 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 that this is intentional. --- diff --git a/runtime/linux/uprobes-inode.c b/runtime/linux/uprobes-inode.c index b07e7b666..103da09dd 100644 --- a/runtime/linux/uprobes-inode.c +++ b/runtime/linux/uprobes-inode.c @@ -792,7 +792,7 @@ stapiu_change_semaphore_plus(struct stapiu_consumer* c, struct task_struct *task if (! any_found) spin_unlock_irqrestore(&c->process_list_lock, flags); else - ; // already unlocked + {}; // already unlocked return rc; }