Test fix: passing bool argument to va_start is undefined
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 2 Feb 2019 13:09:55 +0000 (08:09 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 7 Feb 2019 16:47:02 +0000 (11:47 -0500)
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 <jeremie.galarneau@efficios.com>
tests/unit/test_string_utils.c

index 9596af83ed7bd299063714d3bfcc9d00492e2ef2..c60168a9e0c7bacfd9887b0228991a2894016948 100644 (file)
@@ -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;
This page took 0.026339 seconds and 5 git commands to generate.