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

selftests/clone3: Fix build error

When compiling the selftests with the -std=gnu99 option the build can
fail with.

Following build error:

test_core.c: In function ‘test_cgcore_destroy’:
test_core.c:87:2: error: ‘for’ loop initial declarations are only
allowed in C99 mode
for (int i = 0; i < 10; i++) {
^
test_core.c:87:2: note: use option -std=c99 or -std=gnu99 to compile

Add -std=gnu99 to the clone3 selftest Makefile to fix this.

Signed-off-by: Xingxing Su <suxingxing@loongson.cn>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Xingxing Su and committed by
Shuah Khan
88f4ede4 6f39cecd

+1 -1
+1 -1
tools/testing/selftests/clone3/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - CFLAGS += -g -I../../../../usr/include/ 2 + CFLAGS += -g -std=gnu99 -I../../../../usr/include/ 3 3 LDLIBS += -lcap 4 4 5 5 TEST_GEN_PROGS := clone3 clone3_clear_sighand clone3_set_tid \