Skip to content

Commit 33a4e2b

Browse files
committed
libbpf-tools/opensnoop: hint on unused variable
GCC-16 changed the default of the unused-but-set-variable warnings, which now throws an error when -Wall or -Wextra is enabled. sps_cnt is only used when USE_BLAZESYM is defined. This patch does a void cast to hint the compiler to ignore sps_cnt being unused in those cases. * https://gcc.gnu.org/gcc-16/porting_to.html#changes-to-wunused
1 parent e1446ea commit 33a4e2b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

libbpf-tools/opensnoop.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ int handle_event(void *ctx, void *data, size_t data_sz)
289289

290290
blaze_syms_free(syms);
291291
#endif
292+
/* avoid compiler warnings on sps_cnt not being used */
293+
(void) sps_cnt;
292294
return 0;
293295
}
294296

0 commit comments

Comments
 (0)