summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorQuentin Glidic <sardemff7+git@sardemff7.net>2016-07-10 09:00:56 (GMT)
committerQuentin Glidic <sardemff7+git@sardemff7.net>2016-09-24 09:46:36 (GMT)
commit9c36eb912e8c05c849f57f425458d7ab049bb0d9 (patch)
tree301353750bcc17e7209deba7e04e19f0844d3d37 /tools
parent148c1992ac5d8de562b143e46b74f21b563a40ad (diff)
downloadweston-9c36eb912e8c05c849f57f425458d7ab049bb0d9.tar.gz
weston-9c36eb912e8c05c849f57f425458d7ab049bb0d9.tar.xz
zunitc/junit-reporter: Silence pointer-sign warning
/usr/x86_64-pc-linux-gnu/include/libxml2/libxml/xmlstring.h:35:18: warning: pointer targets in passing argument 3 of 'xmlStrPrintf' differ in signedness [-Wpointer-sign] #define BAD_CAST (xmlChar *) ^ tools/zunitc/src/zuc_junit_reporter.c:77:41: note: in expansion of macro 'BAD_CAST' xmlStrPrintf(scratch, sizeof(scratch), BAD_CAST %d, value); ^~~~~~~~ /usr/x86_64-pc-linux-gnu/include/libxml2/libxml/xmlstring.h:98:17: note: expected 'const char *' but argument is of type 'xmlChar * {aka unsigned char *}' xmlStrPrintf (xmlChar *buf, Warning produced by GCC 5.3, 6.1 and Clang 3.8. Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> Reviewed-by: Armin Krezović <krezovic.armin@gmail.com> Tested-by: Armin Krezović <krezovic.armin@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/zunitc/src/zuc_junit_reporter.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/zunitc/src/zuc_junit_reporter.c b/tools/zunitc/src/zuc_junit_reporter.c
index 369f035..5c6b762 100644
--- a/tools/zunitc/src/zuc_junit_reporter.c
+++ b/tools/zunitc/src/zuc_junit_reporter.c
@@ -53,6 +53,12 @@
#define ISO_8601_FORMAT "%Y-%m-%dT%H:%M:%SZ"
+#if LIBXML_VERSION >= 20904
+#define STRPRINTF_CAST
+#else
+#define STRPRINTF_CAST BAD_CAST
+#endif
+
/**
* Internal data.
*/
@@ -68,7 +74,7 @@ static void
set_attribute(xmlNodePtr node, const char *name, int value)
{
xmlChar scratch[MAX_64BIT_STRLEN + 1] = {};
- xmlStrPrintf(scratch, sizeof(scratch), BAD_CAST "%d", value);
+ xmlStrPrintf(scratch, sizeof(scratch), STRPRINTF_CAST "%d", value);
xmlSetProp(node, BAD_CAST name, scratch);
}