Skip to content

Commit

Permalink
added __attribute__((optnone))
Browse files Browse the repository at this point in the history
So, setjmp/longjmp and non-volatile local variables doesn't really mix.
This patch adds __attribute__((optnone)) to describe blocks, to prevent
compilers from optimizing tests and messing up local variables. This
shouldn't be a permanent fix, but does mean tests compiled with
optimizations won't break.
  • Loading branch information
mortie committed Feb 17, 2019
1 parent 5752131 commit 984a4f3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions snow/snow.h
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,7 @@ static int snow_main_function(int argc, char **argv) {
struct _snow_desc_func df = { #name, &snow_test_##name }; \
_snow_arr_push(&_snow.desc_funcs, &df); \
} \
__attribute__((optnone)) \
static void snow_test_##name()

#define subdesc(name) \
Expand Down

0 comments on commit 984a4f3

Please sign in to comment.