From 951b4d882fa2393369656e05efef3bb229e38c1d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 29 Aug 2018 17:51:58 +0200 Subject: Circumvent GCC bugs in test code when optimised MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- test.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test.h') 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); -- cgit v1.2.3-70-g09d2