Skip to content

Commit

Permalink
selftests/clone3: Fix build error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xingxing Su authored and Shuah Khan committed Dec 7, 2020
1 parent 6f39cec commit 88f4ede
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/clone3/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
CFLAGS += -g -I../../../../usr/include/
CFLAGS += -g -std=gnu99 -I../../../../usr/include/
LDLIBS += -lcap

TEST_GEN_PROGS := clone3 clone3_clear_sighand clone3_set_tid \
Expand Down

0 comments on commit 88f4ede

Please sign in to comment.