From: Jérémie Galarneau Date: Sat, 2 Feb 2019 13:09:55 +0000 (-0500) Subject: Test fix: passing bool argument to va_start is undefined X-Git-Tag: v2.12.0-rc1~662 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3f322f1a1a1ce2fc1354699f11ac483d7a3cd5fc;p=lttng-tools.git Test fix: passing bool argument to va_start is undefined clang warns that "passing an object that undergoes default argument promotion to 'va_start' has undefined behaviour [-Wvarargs]". Since va_start's last argument has no known type, the boolean argument is promoted to 'int', which is not guaranteed to have the same size as 'bool'. Signed-off-by: Jérémie Galarneau --- diff --git a/tests/unit/test_string_utils.c b/tests/unit/test_string_utils.c index 9596af83e..c60168a9e 100644 --- a/tests/unit/test_string_utils.c +++ b/tests/unit/test_string_utils.c @@ -26,7 +26,7 @@ /* Number of TAP tests in this file */ #define NUM_TESTS 69 -static void test_one_split(const char *input, char delim, bool escape_delim, +static void test_one_split(const char *input, char delim, int escape_delim, ...) { va_list vl;