aboutsummaryrefslogtreecommitdiffstats
path: root/test.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-06-12 18:48:26 +0200
committerMattias Andrée <maandree@kth.se>2022-06-12 18:48:26 +0200
commit9b483673c0c8a52d81127a23788fa4c976f2b10f (patch)
treef25ded5960dd73ccfe819fc3331f7a2b8c0561a1 /test.h
parentRemove `static` from some `static inline` (diff)
downloadlibsimple-9b483673c0c8a52d81127a23788fa4c976f2b10f.tar.gz
libsimple-9b483673c0c8a52d81127a23788fa4c976f2b10f.tar.bz2
libsimple-9b483673c0c8a52d81127a23788fa4c976f2b10f.tar.xz
Replace to last static inline's with line + extern inline, and fix warnings
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'test.h')
-rw-r--r--test.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/test.h b/test.h
index a961e13..261bdc8 100644
--- a/test.h
+++ b/test.h
@@ -1,6 +1,18 @@
/* See LICENSE file for copyright and license details. */
+#if defined(__GNUC__) && !defined(__clang__)
+# pragma GCC diagnostic ignored "-Wunsuffixed-float-constants"
+# pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#endif
+
+#if defined(__clang__)
+# pragma clang diagnostic ignored "-Wformat-nonliteral"
+# pragma clang diagnostic ignored "-Wdisabled-macro-expansion"
+# pragma clang diagnostic ignored "-Walloca"
+#endif
+
+
#define assert(EXPR)\
do {\
if (EXPR)\
@@ -48,10 +60,14 @@
do {\
char buf__[1024];\
int len__;\
+ size_t i__;\
+ int not_same__ = 0;\
len__ = sprintf(buf__, __VA_ARGS__);\
assert(len__ >= 0);\
assert((size_t)len__ == stderr_n);\
- assert(!memcmp(buf__, (char **)(void *)(&stderr_buf), stderr_n)); \
+ for (i__ = 0; i__ < stderr_n; i__++)\
+ not_same__ |= buf__[i__] ^ stderr_buf[i__];\
+ assert(!not_same__);\
} while (0)