From: Ruben Kerkhof Date: Sun, 5 Mar 2017 17:43:15 +0000 (+0100) Subject: virt plugin: fix build warning X-Git-Tag: collectd-5.8.0~212 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=a2c13aaeec9412ac4cb2aac1a2cd7e0f725f79e0 virt plugin: fix build warning CC src/virt_la-virt.lo src/virt.c:417:37: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] if ((tag_index < 0) || (tag_index >= STATIC_ARRAY_SIZE(tags))) { ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. --- diff --git a/src/virt.c b/src/virt.c index 692088c4..e95a31b4 100644 --- a/src/virt.c +++ b/src/virt.c @@ -414,7 +414,7 @@ static void memory_stats_submit(gauge_t value, virDomainPtr dom, "minor_fault", "unused", "available", "actual_balloon", "rss"}; - if ((tag_index < 0) || (tag_index >= STATIC_ARRAY_SIZE(tags))) { + if ((tag_index < 0) || (tag_index >= (int)STATIC_ARRAY_SIZE(tags))) { ERROR("virt plugin: Array index out of bounds: tag_index = %d", tag_index); return; }