From d5c534b0d1acbb3b3d50c83fa4318eb13925a72c Mon Sep 17 00:00:00 2001 From: Alex <1132174766@qq.com> Date: Thu, 21 Sep 2023 16:59:22 +0800 Subject: [PATCH] Fix test suit core_stacktrace fail using clang Use predefined macros`__clang__` to distinguish between clang and gcc to make sure the correct optimization attribute. --- tests/dump_core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/dump_core.c b/tests/dump_core.c index c22f57e0..82314e15 100644 --- a/tests/dump_core.c +++ b/tests/dump_core.c @@ -15,7 +15,11 @@ static char const *prefix = "/tmp/satyr.core"; +#if __clang__ +__attribute__((optnone)) +#else __attribute__((optimize((0)))) +#endif int dump_core(int depth, char **name)