Antoine Naud [Fri, 25 May 2018 14:42:51 +0000 (15:42 +0100)]
src/virt.c: Fix one -Wshadow type warning
This commit fixes:
src/virt.c:1827:76: warning: declaration shadows a variable in the global scope
[-Wshadow]
static int domain_lifecycle_event_cb(__attribute__((unused)) virConnectPtr conn,
^
src/virt.c:471:22: note: previous declaration is here
static virConnectPtr conn;
Change-Id: I5303f834c5f13802909f8bd03afba0f4a23934d4 Signed-off-by: Antoine Naud <antoinex.naud@intel.com>
Ruben Kerkhof [Sun, 3 Jun 2018 22:09:07 +0000 (00:09 +0200)]
ceph plugin: fix a few format specifiers
CC src/ceph_la-ceph.lo
In file included from ./src/daemon/common.h:33,
from src/ceph.c:31:
src/ceph.c: In function ‘cconn_handle_event’:
src/ceph.c:1161:11: warning: format ‘%d’ expects argument of type ‘int’, but argument 6 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,amt=%d,ret=%d)",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
io->d->name, io->state, io->amt, ret);
~~~
./src/daemon/plugin.h:396:42: note: in definition of macro ‘DEBUG’
#define DEBUG(...) plugin_log(LOG_DEBUG, __VA_ARGS__)
^~~~~~~~~~~
src/ceph.c:1183:11: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%d)",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
io->d->name, io->state, ret);
~~~
./src/daemon/plugin.h:396:42: note: in definition of macro ‘DEBUG’
#define DEBUG(...) plugin_log(LOG_DEBUG, __VA_ARGS__)
^~~~~~~~~~~
src/ceph.c:1209:11: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%d)",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
io->d->name, io->state, ret);
~~~
./src/daemon/plugin.h:396:42: note: in definition of macro ‘DEBUG’
#define DEBUG(...) plugin_log(LOG_DEBUG, __VA_ARGS__)
^~~~~~~~~~~
src/ceph.c:1230:11: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%d)",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
io->d->name, io->state, ret);
~~~
./src/daemon/plugin.h:396:42: note: in definition of macro ‘DEBUG’
#define DEBUG(...) plugin_log(LOG_DEBUG, __VA_ARGS__)
^~~~~~~~~~~
Ruben Kerkhof [Fri, 1 Jun 2018 12:43:49 +0000 (14:43 +0200)]
csv plugin: fix implicit conversion warning
src/csv.c:193:17: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
int len = strlen(datadir);
~~~ ^~~~~~~~~~~~~~~
Ruben Kerkhof [Thu, 31 May 2018 14:40:08 +0000 (16:40 +0200)]
scanner.l: fix a few implicit conversion warnings
LEX src/liboconfig/scanner.c
CC src/liboconfig/liboconfig_la-scanner.lo
src/liboconfig/scanner.l:113:12: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
int len = strlen (yytext);
~~~ ^~~~~~~~~~~~~~~
src/liboconfig/scanner.l:129:12: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
int len = strlen (yytext);
~~~ ^~~~~~~~~~~~~~~
Ruben Kerkhof [Thu, 31 May 2018 13:29:08 +0000 (15:29 +0200)]
write_sensu plugin: fix implicit conversion
CC src/write_sensu.lo
src/write_sensu.c:312:13: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
int len = strlen(orig_name);
~~~ ^~~~~~~~~~~~~~~~~
1 warning generated.
Ruben Kerkhof [Tue, 29 May 2018 16:22:01 +0000 (18:22 +0200)]
intel_rdt: fix format specifier
Fixes build on F-26:
src/intel_rdt.c: In function 'rdt_dump_cgroups':
src/intel_rdt.c:34:20: error: format '%d' expects argument of type 'int', but argument 3 has type 'size_t {aka long unsigned int}' [-Werror=format=]
#define RDT_PLUGIN "intel_rdt"
^
./src/daemon/plugin.h:396:42: note: in definition of macro 'DEBUG'
#define DEBUG(...) plugin_log(LOG_DEBUG, __VA_ARGS__)
^~~~~~~~~~~
src/intel_rdt.c:79:11: note: in expansion of macro 'RDT_PLUGIN'
DEBUG(RDT_PLUGIN ": group[%d]:", i);
^~~~~~~~~~
src/intel_rdt.c:79:33: note: format string is defined here
DEBUG(RDT_PLUGIN ": group[%d]:", i);
~^
%ld
Ruben Kerkhof [Tue, 29 May 2018 14:36:44 +0000 (16:36 +0200)]
intel_rdt: fix a bunch of warnings
CC src/intel_rdt_la-intel_rdt.lo
src/intel_rdt.c: In function ‘rdt_is_core_id_valid’:
src/intel_rdt.c:163:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
for (int i = 0; i < g_rdt->pqos_cpu->num_cores; i++)
^
src/intel_rdt.c:164:17: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
if (core_id == g_rdt->pqos_cpu->cores[i].lcore)
^~
src/intel_rdt.c: In function ‘rdt_config_cgroups’:
src/intel_rdt.c:208:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
for (int i = 0; i < g_rdt->cap_mon->u.mon->num_events; i++)
^
src/intel_rdt.c: In function ‘rdt_read’:
src/intel_rdt.c:389:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
for (int i = 0; i < g_rdt->num_groups; i++) {
^
src/intel_rdt.c: In function ‘rdt_init’:
src/intel_rdt.c:428:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
for (int i = 0; i < g_rdt->num_groups; i++) {
^
src/intel_rdt.c: In function ‘rdt_shutdown’:
src/intel_rdt.c:451:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
for (int i = 0; i < g_rdt->num_groups; i++) {
^
CC src/intel_rdt_la-utils_config_cores.lo
src/utils_config_cores.c: In function ‘check_core_grouping’:
src/utils_config_cores.c:166:23: warning: comparison of integer expressions of different signedness: ‘long int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
if ((end - start) >= out_size) {
^~
CCLD intel_rdt.la
Ruben Kerkhof [Tue, 29 May 2018 13:57:00 +0000 (15:57 +0200)]
virt plugin: fix a few sign compare warnings
CC src/virt_la-virt.lo
src/virt.c: In function ‘domain_state_submit_notif’:
src/virt.c:1019:29: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
if ((state < 0) || (state >= STATIC_ARRAY_SIZE(domain_states))) {
^~
src/virt.c:1027:31: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
if ((reason < 0) || (reason >= STATIC_ARRAY_SIZE(domain_reasons[0]))) {
^~
src/virt.c: In function ‘fs_info_notify’:
src/virt.c:1612:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
for (int i = 0; i < fs_info->ndevAlias; ++i) {
^
src/virt.c:1587:25: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
for (int _i = 0; _i < _size; ++_i) { \
^
src/virt.c:1619:3: note: in expansion of macro ‘NM_ADD_STR_ITEMS’
NM_ADD_STR_ITEMS(fs_str_items, STATIC_ARRAY_SIZE(fs_str_items));
^~~~~~~~~~~~~~~~
src/virt.c:1587:25: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
for (int _i = 0; _i < _size; ++_i) { \
^
src/virt.c:1622:3: note: in expansion of macro ‘NM_ADD_STR_ITEMS’
NM_ADD_STR_ITEMS(fs_dev_alias, fs_info->ndevAlias);
^~~~~~~~~~~~~~~~
CCLD virt.la
Ruben Kerkhof [Tue, 29 May 2018 09:29:52 +0000 (11:29 +0200)]
dpdkevents plugin: fix sign compare warnings
src/dpdkevents.c: In function ‘dpdk_helper_link_status_get’:
src/dpdkevents.c:431:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
for (int i = 0; i < ec->nb_ports; i++) {
^
src/dpdkevents.c: In function ‘dpdk_events_link_status_dispatch’:
src/dpdkevents.c:500:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
for (int i = 0; i < ec->nb_ports; i++) {
^
Ruben Kerkhof [Tue, 29 May 2018 09:25:10 +0000 (11:25 +0200)]
ipmi plugin: fix sign compare warning
CC src/ipmi_la-ipmi.lo
src/ipmi.c: In function ‘sensor_unit_to_type’:
src/ipmi.c:360:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
for (int i = 0; i < STATIC_ARRAY_SIZE(ipmi_db_type_map); i++)
^
Ruben Kerkhof [Tue, 29 May 2018 09:23:25 +0000 (11:23 +0200)]
amqp1 plugin: fix sign compare warning
CC src/amqp1_la-amqp1.lo
src/amqp1.c: In function ‘amqp1_send_out_messages’:
src/amqp1.c:138:29: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
if (DEQ_SIZE(to_send) == link_credit)
^~
Ruben Kerkhof [Tue, 29 May 2018 08:37:18 +0000 (10:37 +0200)]
turbostat plugin: free the right variable
scan-build: Using '/usr/bin/clang-6.0' for static analysis
make all-am
make[1]: Entering directory '/home/ruben/src/collectd'
CC src/turbostat.lo
src/turbostat.c:1292:5: warning: Argument to free() is the address of the global variable 'thread_delta', which is not memory allocated by malloc()
sfree(threads);
^~~~~~~~~~~~~~
./src/daemon/common.h:41:5: note: expanded from macro 'sfree'
free(ptr); \
^~~~~~~~~
src/turbostat.c:1299:5: warning: Argument to free() is the address of the global variable 'core_delta', which is not memory allocated by malloc()
sfree(cores);
^~~~~~~~~~~~
./src/daemon/common.h:41:5: note: expanded from macro 'sfree'
free(ptr); \
^~~~~~~~~
2 warnings generated.
CCLD turbostat.la
Ruben Kerkhof [Wed, 23 May 2018 13:41:25 +0000 (15:41 +0200)]
processes plugin: fix build warning
src/processes.c:999:24: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
tpid) >= sizeof(filename)) {
~~~~~ ^ ~~~~~~~~~~~~~~~~
Ruben Kerkhof [Wed, 23 May 2018 13:39:23 +0000 (15:39 +0200)]
table plugin: fix build warning
src/table.c:399:11: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
if (r >= sizeof(vl.type_instance))
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Ruben Kerkhof [Wed, 23 May 2018 13:38:26 +0000 (15:38 +0200)]
netlink plugin: fix build warnings
src/netlink.c:546:13: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
if (r >= sizeof(type_instance)) {
~ ^ ~~~~~~~~~~~~~~~~~~~~~
src/netlink.c:585:13: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
if (r >= sizeof(type_instance)) {
~ ^ ~~~~~~~~~~~~~~~~~~~~~
Ruben Kerkhof [Wed, 16 May 2018 11:24:55 +0000 (13:24 +0200)]
Fix make distcheck on Mac OS
CC src/libcollectdclient/libcollectdclient_la-network_parse.lo
../../src/libcollectdclient/network_parse.c:49:10: fatal error: 'stdendian.h' file not found
^~~~~~~~~~~~~
1 error generated.
Pavel Rochnyack [Mon, 21 May 2018 03:38:51 +0000 (10:38 +0700)]
Added missing include of 'config.h'
This adressed to solve compilation issue on Solaris platform:
In file included from src/libcollectdclient/network_parse.c:26:0,
from src/libcollectdclient/network_parse_test.c:32:
./src/config.h:1517:0: error: "_FILE_OFFSET_BITS" redefined
Pavel Rochnyack [Sun, 20 May 2018 19:35:44 +0000 (02:35 +0700)]
Added missing include of 'kstat.h' and variable declaration
This adressed to solve compilation issue on Solaris platform:
src/daemon/collectd.c:212: error: 'kc' undeclared (first use in this function)
src/daemon/collectd.c:213: error: implicit declaration of function 'kstat_open'