linux-stable/tools
James Hilliard ddb560051a selftests/bpf: Fix conflicts with built-in functions in bpf_iter_ksym
[ Upstream commit ab0350c743 ]

Both tolower and toupper are built in c functions, we should not
redefine them as this can result in a build error.

Fixes the following errors:
progs/bpf_iter_ksym.c:10:20: error: conflicting types for built-in function 'tolower'; expected 'int(int)' [-Werror=builtin-declaration-mismatch]
   10 | static inline char tolower(char c)
      |                    ^~~~~~~
progs/bpf_iter_ksym.c:5:1: note: 'tolower' is declared in header '<ctype.h>'
    4 | #include <bpf/bpf_helpers.h>
  +++ |+#include <ctype.h>
    5 |
progs/bpf_iter_ksym.c:17:20: error: conflicting types for built-in function 'toupper'; expected 'int(int)' [-Werror=builtin-declaration-mismatch]
   17 | static inline char toupper(char c)
      |                    ^~~~~~~
progs/bpf_iter_ksym.c:17:20: note: 'toupper' is declared in header '<ctype.h>'

See background on this sort of issue:
https://stackoverflow.com/a/20582607
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12213

(C99, 7.1.3p1) "All identifiers with external linkage in any of the
following subclauses (including the future library directions) are
always reserved for use as identifiers with external linkage."

This is documented behavior in GCC:
https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-std-2

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20221203010847.2191265-1-james.hilliard1@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:26:46 +01:00
..
accounting delayacct: remove some unused variables 2022-06-16 19:58:21 -07:00
arch x86/cpu: Restore AMD's DE_CFG MSR after resume 2022-11-16 10:04:14 +01:00
bootconfig
bpf bpftool: Fix memory leak in do_build_table_cb 2022-12-31 13:26:09 +01:00
build tools build: Switch to new openssl API for test-libcrypto 2022-08-10 10:44:02 -03:00
certs tools/certs: Add print-cert-tbs-hash.sh 2022-05-23 18:47:49 +03:00
cgroup tools: add memcg_shrinker.py 2022-07-03 18:08:40 -07:00
counter
debugging tools: Add new "test" taint to kernel-chktaint 2022-09-07 14:51:12 -06:00
edid
firewire
firmware
gpio
hv tools: hv: kvp: remove unnecessary (void*) conversions 2022-09-05 16:55:20 +00:00
iio tools: iio: iio_generic_buffer: Fix read size 2022-12-02 17:43:14 +01:00
include tools/nolibc/string: Fix memcmp() implementation 2022-11-10 18:17:33 +01:00
io_uring
kvm/kvm_stat tools/kvm_stat: fix display of error when multiple processes are found 2022-06-15 08:14:20 -04:00
laptop
leds
lib libbpf: Avoid enum forward-declarations in public API in C++ mode 2022-12-31 13:26:46 +01:00
memory-model
objtool objtool, kcsan: Add volatile read/write instrumentation to whitelist 2022-12-31 13:25:36 +01:00
pci
pcmcia
perf perf stat: Do not delay the workload with --delay 2022-12-31 13:26:31 +01:00
power tools/power turbostat: Use standard Energy Unit for SPR Dram RAPL domain 2022-10-21 12:39:02 +02:00
rcu
scripts
spi spi: spidev_test: Warn when the mode is not the requested mode 2022-06-13 15:56:03 +01:00
testing selftests/bpf: Fix conflicts with built-in functions in bpf_iter_ksym 2022-12-31 13:26:46 +01:00
thermal tools/thermal: Fix possible path truncations 2022-08-03 19:28:46 +02:00
time
tracing rtla: Consolidate and show all necessary libraries that failed for building 2022-08-10 12:03:02 -04:00
usb tools: usb: testusb: Add super-plus speed reporting 2022-07-08 14:54:49 +02:00
verification rv/dot2c: Make automaton definition static 2022-10-29 10:08:35 +02:00
virtio virtio_test: fixup for vq reset 2022-09-27 18:30:49 -04:00
vm tools/vm/slabinfo-gnuplot: use "grep -E" instead of "egrep" 2022-12-08 11:30:19 +01:00
wmi
Makefile tools/nolibc: make the default target build the headers 2022-06-20 09:43:19 -07:00