diff options
author | Mattias Andrée <maandree@kth.se> | 2018-08-29 17:51:58 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2018-08-29 17:51:58 +0200 |
commit | 951b4d882fa2393369656e05efef3bb229e38c1d (patch) | |
tree | 1630753309c5e0d993345d7a4a41cf45dab1cde8 /test.h | |
parent | Add readme (diff) | |
download | libsimple-951b4d882fa2393369656e05efef3bb229e38c1d.tar.gz libsimple-951b4d882fa2393369656e05efef3bb229e38c1d.tar.bz2 libsimple-951b4d882fa2393369656e05efef3bb229e38c1d.tar.xz |
Circumvent GCC bugs in test code when optimised
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | test.h | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -51,7 +51,7 @@ len__ = sprintf(buf__, FMT, __VA_ARGS__);\ assert(len__ >= 0);\ assert((size_t)len__ == stderr_n);\ - assert(!memcmp(buf__, stderr_buf, stderr_n));\ + assert(!memcmp(buf__, (char **)(void *)(&stderr_buf), stderr_n)); \ } while (0); @@ -68,15 +68,15 @@ struct allocinfo { extern char *argv0; -extern size_t alloc_fail_in; -extern int exit_real; -extern int exit_ok; -extern int exit_status; +extern volatile size_t alloc_fail_in; +extern volatile int exit_real; +extern volatile int exit_ok; +extern volatile int exit_status; extern jmp_buf exit_jmp; -extern char stderr_buf[8 << 10]; -extern size_t stderr_n; -extern int stderr_real; -extern int stderr_ok; +extern volatile char stderr_buf[8 << 10]; +extern volatile size_t stderr_n; +extern volatile int stderr_real; +extern volatile int stderr_ok; size_t get_pagesize(void); |