* [PATCH v2] selftests/clone3: Fix build error
@ 2020-11-27 3:16 Xingxing Su
2020-12-07 22:02 ` Shuah Khan
0 siblings, 1 reply; 2+ messages in thread
From: Xingxing Su @ 2020-11-27 3:16 UTC (permalink / raw)
To: Christian Brauner, Shuah Khan; +Cc: linux-kernel, linux-kselftest
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>
---
tools/testing/selftests/clone3/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/clone3/Makefile b/tools/testing/selftests/clone3/Makefile
index ef7564c..88354a8 100644
--- a/tools/testing/selftests/clone3/Makefile
+++ b/tools/testing/selftests/clone3/Makefile
@@ -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 \
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] selftests/clone3: Fix build error
2020-11-27 3:16 [PATCH v2] selftests/clone3: Fix build error Xingxing Su
@ 2020-12-07 22:02 ` Shuah Khan
0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2020-12-07 22:02 UTC (permalink / raw)
To: Xingxing Su, Christian Brauner, Shuah Khan
Cc: linux-kernel, linux-kselftest, Shuah Khan
On 11/26/20 8:16 PM, Xingxing Su wrote:
> 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>
> ---
> tools/testing/selftests/clone3/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/clone3/Makefile b/tools/testing/selftests/clone3/Makefile
> index ef7564c..88354a8 100644
> --- a/tools/testing/selftests/clone3/Makefile
> +++ b/tools/testing/selftests/clone3/Makefile
> @@ -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 \
>
Applied to linux-kselftest fixes for 5.11-rc1
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-07 22:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27 3:16 [PATCH v2] selftests/clone3: Fix build error Xingxing Su
2020-12-07 22:02 ` Shuah Khan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).