linux/tools
Thomas Weißschuh 4ed03f639e selftests/nolibc: libc-test: avoid -Wstringop-overflow warnings
Newer versions of glibc annotate the poll() function with
__attribute__(access) which triggers a compiler warning inside the
testcase poll_fault.
Avoid this by using a plain NULL which is enough for the testcase.
To avoid potential future warnings also adapt the other EFAULT
testcases, except select_fault as NULL is a valid value for its
argument.

nolibc-test.c: In function ‘run_syscall’:
nolibc-test.c:338:62: warning: ‘poll’ writing 8 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
  338 |         do { if (!(cond)) result(llen, SKIPPED); else ret += expect_syserr2(expr, expret, experr1, experr2, llen); } while (0)
      |                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nolibc-test.c:341:9: note: in expansion of macro ‘EXPECT_SYSER2’
  341 |         EXPECT_SYSER2(cond, expr, expret, experr, 0)
      |         ^~~~~~~~~~~~~
nolibc-test.c:905:47: note: in expansion of macro ‘EXPECT_SYSER’
  905 |                 CASE_TEST(poll_fault);        EXPECT_SYSER(1, poll((void *)1, 1, 0), -1, EFAULT); break;
      |                                               ^~~~~~~~~~~~
cc1: note: destination object is likely at address zero
In file included from /usr/include/poll.h:1,
                 from nolibc-test.c:33:
/usr/include/sys/poll.h:54:12: note: in a call to function ‘poll’ declared with attribute ‘access (write_only, 1, 2)’
   54 | extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout)
      |            ^~~~

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
2023-10-12 21:14:05 +02:00
..
accounting
arch ARM: 2023-09-07 13:52:20 -07:00
bootconfig
bpf bpftool: Fix build warnings with -Wtype-limits 2023-08-30 08:39:00 +02:00
build perf tools changes for v6.6: 2023-09-09 20:06:17 -07:00
certs
cgroup iocost_monitor: improve it by adding iocg wait_ms 2023-08-08 15:43:03 -06:00
counter tools/counter: Makefile: Replace rmdir by rm to avoid make,clean failure 2023-07-24 10:29:52 -04:00
crypto/ccp crypto: ccp - Add unit tests for dynamic boost control 2023-07-20 22:15:12 +12:00
debugging
edid
firewire
firmware
gpio
hv vmbus_testing: fix wrong python syntax for integer value comparison 2023-07-23 23:19:30 +00:00
iio tools: iio: iio_generic_buffer: Fix some integer type and calculation 2023-07-29 15:59:20 +01:00
include tools/nolibc: string: Remove the _nolibc_memcpy_up() function 2023-10-12 21:14:03 +02:00
kvm/kvm_stat
laptop
leds
lib perf tools changes for v6.6: 2023-09-09 20:06:17 -07:00
memory-model
mm tools/mm: fix undefined reference to pthread_once 2023-09-05 10:13:45 -07:00
net/ynl tools/net/ynl: Add support for create flags 2023-08-27 17:17:10 -07:00
objtool objtool/x86: Fixup frame-pointer vs rethunk 2023-08-17 00:44:35 +02:00
pci
pcmcia
perf perf tools changes for v6.6: 2023-09-09 20:06:17 -07:00
power More power management updates for 6.6-rc1 2023-09-04 15:21:55 -07:00
rcu
scripts tools build: Add 3-component logical version comparators 2023-08-03 16:59:40 -03:00
spi
testing selftests/nolibc: libc-test: avoid -Wstringop-overflow warnings 2023-10-12 21:14:05 +02:00
thermal
time
tracing
usb
verification
virtio
wmi
workqueue workqueue: Implement non-strict affinity scope for unbound workqueues 2023-08-07 15:57:25 -10:00
Makefile