Fix warnings reported by CLANG,
the C warning generator.
This commit is contained in:
1 parent
690fd72c8b
commit
d9401371a6
5 files changed
+16
-7
No files matched your search
+5
-3
@@ -887,13 +887,15 @@ static void test_M_CSTR(void)
|
||||
#undef M_USE_CSTR_ALLOC
|
||||
#define M_USE_CSTR_ALLOC 8
|
||||
// Disable GNUC warning as we want to test this behavior.
|
||||
// this warning is not supported by CLANG
|
||||
#if defined (__GNUC__) && __GNUC__ >= 7 && !defined(__clang__)
|
||||
// this warning is supported by CLANG
|
||||
#if (defined (__GNUC__) && __GNUC__ >= 7 && !defined(__clang__)) \
|
||||
||(defined(__clang__) && __clang_major__ >= 18)
|
||||
_Pragma("GCC diagnostic push")
|
||||
_Pragma("GCC diagnostic ignored \"-Wformat-truncation\"")
|
||||
#endif
|
||||
r = strcmp(M_CSTR("Hello %s %c", "World", '!'), "Hello W");
|
||||
#if defined(__GNUC__) && __GNUC__ >= 7 && !defined(__clang__)
|
||||
#if (defined (__GNUC__) && __GNUC__ >= 7 && !defined(__clang__)) \
|
||||
||(defined(__clang__) && __clang_major__ >= 18)
|
||||
_Pragma("GCC diagnostic pop")
|
||||
#endif
|
||||
assert (r == 0);
|
||||
|
||||
@@ -31,7 +31,7 @@ static int fib(int n);
|
||||
struct fib2_s {
|
||||
int x, n;
|
||||
};
|
||||
atomic_bool resetFunc_called = ATOMIC_VAR_INIT(false);
|
||||
atomic_bool resetFunc_called = M_ATOMIC_VAR_INIT(false);
|
||||
static void resetFunc(void)
|
||||
{
|
||||
atomic_store(&resetFunc_called, true);
|
||||
|
||||
Reference in new issue
Block a user