Re: [PATCH 2/4] selftests/ptrace: add test cases for dead-locks

From: Dmitry V. Levin
Date: Tue Mar 10 2020 - 18:41:06 EST


On Tue, Mar 10, 2020 at 02:44:01PM +0100, Bernd Edlinger wrote:
> This adds test cases for ptrace deadlocks.
>
> Additionally fixes a compile problem in get_syscall_info.c,
> observed with gcc-4.8.4:
>
> get_syscall_info.c: In function 'get_syscall_info':
> get_syscall_info.c:93:3: error: 'for' loop initial declarations are only
> allowed in C99 mode
> for (unsigned int i = 0; i < ARRAY_SIZE(args); ++i) {
> ^
> get_syscall_info.c:93:3: note: use option -std=c99 or -std=gnu99 to compile
> your code
[...]
> @@ -1,6 +1,6 @@
> # SPDX-License-Identifier: GPL-2.0-only
> -CFLAGS += -iquote../../../../include/uapi -Wall
> +CFLAGS += -std=c99 -pthread -iquote../../../../include/uapi -Wall

Wouldn't it be better to choose -std=gnu99 over -std=c99?


--
ldv