]> sourceware.org Git - systemtap.git/commitdiff
Avoid -Werror=empty-body errors from runtime/linux/uprobes-inode.c
authorWilliam Cohen <wcohen@redhat.com>
Mon, 3 Jun 2024 19:46:49 +0000 (15:46 -0400)
committerWilliam Cohen <wcohen@redhat.com>
Tue, 4 Jun 2024 14:07:34 +0000 (10:07 -0400)
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.

runtime/linux/uprobes-inode.c

index b07e7b666f516a2ca8cfbb9539dcbcfd79144c06..103da09ddffc3deb14383adeab0e358e7cc8f6b1 100644 (file)
@@ -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;
 }
This page took 0.027711 seconds and 5 git commands to generate.