diff options
author | Mattias Andrée <maandree@kth.se> | 2022-06-12 18:48:26 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2022-06-12 18:48:26 +0200 |
commit | 9b483673c0c8a52d81127a23788fa4c976f2b10f (patch) | |
tree | f25ded5960dd73ccfe819fc3331f7a2b8c0561a1 /test.h | |
parent | Remove `static` from some `static inline` (diff) | |
download | libsimple-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.h | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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) |