Skip to content

Commit

Permalink
Fix test suit core_stacktrace fail using clang
Browse files Browse the repository at this point in the history
Use predefined macros`__clang__` to distinguish between clang and gcc to make sure the correct optimization attribute.
  • Loading branch information
MANGOPIE3 authored and msrb committed Jan 27, 2024
1 parent 23483ce commit d5c534b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/dump_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d5c534b

Please sign in to comment.