From 59241ba1e5f979605b24aa613b52f06473de8147 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Fri, 3 May 2019 18:26:57 -0400 Subject: [PATCH] Fix: common: va_list type is implementation dependant MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Issue ===== BT_ASSERT(*args) happens to work on some library implementations because the va_list type happens to be a pointer but this is not true with all libraries. For example, compiling on arm64 results in the following error: In file included from common.c:34:0: common.c: In function ‘bt_common_custom_vsnprintf’: ../include/babeltrace/assert-internal.h:42:7: error: wrong type argument to unary exclamation mark if (!(_cond)) { \ ^ common.c:1524:2: note: in expansion of macro ‘BT_ASSERT’ BT_ASSERT(*args); ^~~~~~~~~ Solution ======== Remove that BT_ASSERT() call as its intent is unclear anyway. Drawback ======== None. Signed-off-by: Francis Deslauriers Change-Id: Iada5189ef4580e48caefed12835bfab7c23eaf73 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1253 CI-Build: Jérémie Galarneau Reviewed-by: Michael Jeanson Reviewed-by: Jérémie Galarneau --- common/common.c | 1 - 1 file changed, 1 deletion(-) diff --git a/common/common.c b/common/common.c index d261372d..de98e34c 100644 --- a/common/common.c +++ b/common/common.c @@ -1521,7 +1521,6 @@ void bt_common_custom_vsnprintf(char *buf, size_t buf_size, BT_ASSERT(buf); BT_ASSERT(fmt); - BT_ASSERT(*args); while (*fmt_ch != '\0') { switch (*fmt_ch) { -- 2.34.1