linux/tools
Viktor Malik 5763790965
selftests/bpf: Silence maybe-uninitialized compiler warning in libarena
When compiling BPF selftests with -O2, GCC reports a maybe-uninitialized
warning in libarena code:

    In file included from /bpf-next/tools/testing/selftests/bpf/prog_tests/libarena_asan.c:11:
    In function ‘libarena_asan_init’,
        inlined from ‘run_test’ at /bpf-next/tools/testing/selftests/bpf/prog_tests/libarena_asan.c:59:8,
        inlined from ‘test_libarena_asan’ at /bpf-next/tools/testing/selftests/bpf/prog_tests/libarena_asan.c:91:2:
    /bpf-next/tools/testing/selftests/bpf/libarena/include/libarena/userspace.h:126:14: error: ‘globals_pages’ may be used uninitialized [-Werror=maybe-uninitialized]
      126 |         args = (struct asan_init_args){
          |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
      127 |                 .arena_all_pages = arena_all_pages,
          |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      128 |                 .arena_globals_pages = globals_pages,
          |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      129 |         };
          |         ~
    /bpf-next/tools/testing/selftests/bpf/libarena/include/libarena/userspace.h: In function ‘test_libarena_asan’:
    /bpf-next/tools/testing/selftests/bpf/libarena/include/libarena/userspace.h:118:13: note: ‘globals_pages’ was declared here
      118 |         u64 globals_pages;
          |             ^~~~~~~~~~~~~

Silence the warning by initializing globals_pages to 0.

Fixes: cfc00618b9 ("selftests/bpf: Add ASAN support for libarena selftests")
Signed-off-by: Viktor Malik <vmalik@redhat.com>
Link: https://lore.kernel.org/bpf/9f77a5c05c3c731ab2655fd66716ab9de4478b15.1784112948.git.vmalik@redhat.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
2026-07-20 21:00:57 +02:00
..
accounting tools/accounting/getdelays: fix -Wformat-truncation warning in format_timespec 2026-05-28 21:24:40 -07:00
arch perf tools changes for v7.2: 2026-06-23 11:34:49 -07:00
bootconfig Bootconfig updates for v7.2 2026-06-16 17:29:24 +05:30
bpf bpftool: Skip prog/map that disappears while looking it up by name 2026-07-20 17:02:31 +02:00
build perf tools changes for v7.2: 2026-06-23 11:34:49 -07:00
certs
cgroup
counter
crypto
debugging
dma
docs
firewire
firmware
gpio
hv tools: hv: Fix cross-compilation 2026-04-14 04:43:26 +00:00
iio iio: core: Add IIO_COVERAGE channel type 2026-05-31 11:01:50 +01:00
include Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 7.2-rc4 2026-07-17 23:22:46 +02:00
kvm/kvm_stat
laptop
leds
lib libbpf: Fix double-free of distilled base BTF on .BTF.ext parse error 2026-07-10 14:53:29 -07:00
memory-model
mm slab changes for 7.2 - part 2 2026-06-22 08:28:48 -07:00
net tools/ynl: add missing uapi header deps in Makefile.deps 2026-06-24 19:30:55 -07:00
objtool objtool/klp: Cache dont_correlate() result 2026-05-04 21:16:07 -07:00
pcmcia
perf perf tools changes for v7.2: 2026-06-23 11:34:49 -07:00
power platform-drivers-x86 for v7.2-1 2026-06-23 08:31:33 -07:00
rcu
sched
sched_ext Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 7.2-rc4 2026-07-17 23:22:46 +02:00
scripts Kbuild/Kconfig updates for 7.1 2026-04-14 09:18:40 -07:00
sound
spi
testing selftests/bpf: Silence maybe-uninitialized compiler warning in libarena 2026-07-20 21:00:57 +02:00
thermal
time
tracing rtla: Also link in ctype.c 2026-07-08 10:38:18 +02:00
unittests docs: kernel-doc: python: strip __counted_by_ptr macro 2026-05-15 08:11:36 -06:00
usb usbip: tools: support SuperSpeedPlus devices 2026-07-08 13:29:13 +02:00
verification verification/rvgen: Fix ltl2k writing True as a literal 2026-06-04 16:44:25 +02:00
virtio tools/virtio: add missing compat definitions for vhost_net_test 2026-07-01 19:02:56 -07:00
wmi
workqueue
writeback
Makefile