samples, bpf: suppress compiler warning
Matteo Croce authored
[ Upstream commit a195ceff ]

GCC 9 fails to calculate the size of local constant strings and produces a
false positive:

samples/bpf/task_fd_query_user.c: In function ‘test_debug_fs_uprobe’:
samples/bpf/task_fd_query_user.c:242:67: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 215 [-Wformat-truncation=]
  242 |  snprintf(buf, sizeof(buf), "/sys/kernel/debug/tracing/events/%ss/%s/id",
      |                                                                   ^~
  243 |    event_type, event_alias);
      |                ~~~~~~~~~~~
samples/bpf/task_fd_query_user.c:242:2: note: ‘snprintf’ output between 45 and 300 bytes into a destination of size 256
  242 |  snprintf(buf, sizeof(buf), "/sys/kernel/debug/tracing/events/%ss/%s/id",
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  243 |    event_type, event_alias);
      |    ~~~~~~~~~~~~~~~~~~~...
3ab0e4bc
Name Last commit Last update
..
auxdisplay auxdisplay: Replace licenses with SPDX identifiers
binderfs samples: add binderfs sample program
bpf samples, bpf: suppress compiler warning
configfs configfs: make config_item_type const
connector kbuild: announce removal of SUBDIRS if used
hidraw HID: samples/hidraw: fix typo in printed message
hw_breakpoint perf: Add context field to perf_event
kdb kdb: Add kdb kernel module sample
kfifo kfifo: clean up example to not use page_link
kobject kobject: Remove redundant license text
kprobes arch: remove tile port
livepatch Merge branch 'for-5.0/upstream-fixes' into for-linus
mei samples: mei: use /dev/mei0 instead of /dev/mei
mic/mpssd samples/mic/mpssd/mpssd.h: remove duplicate header
pktgen Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
qmi samples: Introduce Qualcomm QMI sample client
rpmsg rpmsg: Allow callback to return errors
seccomp samples/seccomp: Fix 32-bit build
statx kbuild: remove all dummy assignments to obj-
timers License cleanup: add SPDX GPL-2.0 license identifier to files with no license
trace_events Merge branch 'for-linus' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
trace_printk tracing: Add trace_printk sample code
uhid kbuild: remove all dummy assignments to obj-
v4l media: v4l2-pci-skeleton.c: fix outdated irq code
vfio-mdev samples/vfio-mdev/mtty: expand minor range when registering chrdev region
watchdog License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Kconfig samples: add binderfs sample program
Makefile samples: add binderfs sample program