Fix warnings reported by -Wpedantic
Previously CI hasn't been running with -Wpedantic (using autoconf), so
these haven't been reported previously.
- replace BUILD_ASSERT with static_assert()
- don't use %m GNU extension for printf
- don't use arithmetic on void*
- remove unused variables
Change-Id: I97d1acc908f06773b8b1ee95bfee80760fdc7a63
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
diff --git a/tests/test_astlpc.c b/tests/test_astlpc.c
index e8f2bce..48beb4e 100644
--- a/tests/test_astlpc.c
+++ b/tests/test_astlpc.c
@@ -1515,20 +1515,13 @@
};
/* clang-format on */
-#ifndef BUILD_ASSERT
-#define BUILD_ASSERT(x) \
- do { \
- (void)sizeof(char[0 - (!(x))]); \
- } while (0)
-#endif
-
int main(void)
{
size_t i;
mctp_set_log_stdio(MCTP_LOG_DEBUG);
- BUILD_ASSERT(ARRAY_SIZE(astlpc_tests) < SIZE_MAX);
+ static_assert(ARRAY_SIZE(astlpc_tests) < SIZE_MAX, "size");
for (i = 0; i < ARRAY_SIZE(astlpc_tests); i++) {
mctp_prlog(MCTP_LOG_DEBUG, "begin: %s", astlpc_tests[i].name);
astlpc_tests[i].test();