Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/nolibc: drop include guards around standard headers

Nolibc now provides all the headers required by nolibc-test.c.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20250515-nolibc-sys-v1-9-74f82eea3b59@weissschuh.net
Acked-by: Willy Tarreau <w@1wt.eu>

-7
-2
tools/testing/selftests/nolibc/nolibc-test-linkage.c
··· 2 2 3 3 #include "nolibc-test-linkage.h" 4 4 5 - #ifndef NOLIBC 6 5 #include <errno.h> 7 - #endif 8 6 9 7 void *linkage_test_errno_addr(void) 10 8 {
-5
tools/testing/selftests/nolibc/nolibc-test.c
··· 9 9 * $(CC) -nostdlib -I/path/to/nolibc/sysroot => _NOLIBC_* guards are present 10 10 * $(CC) with default libc => NOLIBC* never defined 11 11 */ 12 - #ifndef NOLIBC 13 12 #include <stdio.h> 14 13 #include <stdlib.h> 15 14 #include <string.h> 16 - #ifndef _NOLIBC_STDIO_H 17 - /* standard libcs need more includes */ 18 15 #include <sys/auxv.h> 19 16 #include <sys/ioctl.h> 20 17 #include <sys/mman.h> ··· 40 43 #include <unistd.h> 41 44 #include <limits.h> 42 45 #include <ctype.h> 43 - #endif 44 - #endif 45 46 46 47 #pragma GCC diagnostic ignored "-Wmissing-prototypes" 47 48