From 4482d0009a99b1773f2426479b666b08f57af9d5 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 15 Feb 2018 14:44:18 +0100 Subject: Include sys/ptrace.h as early as possible. On some systems, at least on Fedora 27 ppc64le with glibc 2.26-24 and kernel 4.14.18-300, including sys/ptrace.h late (after signal.h or sys/wait.h for example) will cause issues and produce errors like: In file included from /usr/include/asm/sigcontext.h:12:0, from /usr/include/bits/sigcontext.h:30, from /usr/include/signal.h:287, from /usr/include/sys/wait.h:36, from linux-pid-attach.c:38: /usr/include/sys/ptrace.h:73:3: error: expected identifier before numeric constant PTRACE_GETREGS = 12, ^ Swapping the include order fixes these issues. Signed-off-by: Mark Wielaard --- tests/backtrace-child.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/backtrace-child.c') diff --git a/tests/backtrace-child.c b/tests/backtrace-child.c index 2c27414f..9c6ba94f 100644 --- a/tests/backtrace-child.c +++ b/tests/backtrace-child.c @@ -81,7 +81,6 @@ #include #include #include -#include #include #include #include @@ -100,6 +99,7 @@ main (int argc __attribute__ ((unused)), char **argv) #else /* __linux__ */ #include +#include #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) #define NOINLINE_NOCLONE __attribute__ ((noinline, noclone)) -- cgit v1.2.3