aboutsummaryrefslogtreecommitdiffstats
path: root/test.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-08-29 17:51:58 +0200
committerMattias Andrée <maandree@kth.se>2018-08-29 17:51:58 +0200
commit951b4d882fa2393369656e05efef3bb229e38c1d (patch)
tree1630753309c5e0d993345d7a4a41cf45dab1cde8 /test.h
parentAdd readme (diff)
downloadlibsimple-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 'test.h')
-rw-r--r--test.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/test.h b/test.h
index 60d20ca..3aba488 100644
--- a/test.h
+++ b/test.h
@@ -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);