From: Ruben Kerkhof Date: Sun, 3 Jun 2018 22:09:07 +0000 (+0200) Subject: ceph plugin: fix a few format specifiers X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2a723c6ba214cbf2ebe2a6f3ed856ab5d5805309;p=collectd.git 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__) ^~~~~~~~~~~ --- diff --git a/src/ceph.c b/src/ceph.c index 394719d5..c7fc576a 100644 --- a/src/ceph.c +++ b/src/ceph.c @@ -1158,7 +1158,7 @@ static ssize_t cconn_handle_event(struct cconn *io) { size_t cmd_len = strlen(cmd); RETRY_ON_EINTR( ret, write(io->asok, ((char *)&cmd) + io->amt, cmd_len - io->amt)); - DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,amt=%d,ret=%d)", + DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,amt=%d,ret=%zd)", io->d->name, io->state, io->amt, ret); if (ret < 0) { return ret; @@ -1180,7 +1180,7 @@ static ssize_t cconn_handle_event(struct cconn *io) { case CSTATE_READ_VERSION: { RETRY_ON_EINTR(ret, read(io->asok, ((char *)(&io->d->version)) + io->amt, sizeof(io->d->version) - io->amt)); - DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%d)", + DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%zd)", io->d->name, io->state, ret); if (ret < 0) { return ret; @@ -1206,7 +1206,7 @@ static ssize_t cconn_handle_event(struct cconn *io) { case CSTATE_READ_AMT: { RETRY_ON_EINTR(ret, read(io->asok, ((char *)(&io->json_len)) + io->amt, sizeof(io->json_len) - io->amt)); - DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%d)", + DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%zd)", io->d->name, io->state, ret); if (ret < 0) { return ret; @@ -1227,7 +1227,7 @@ static ssize_t cconn_handle_event(struct cconn *io) { case CSTATE_READ_JSON: { RETRY_ON_EINTR(ret, read(io->asok, io->json + io->amt, io->json_len - io->amt)); - DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%d)", + DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%zd)", io->d->name, io->state, ret); if (ret < 0) { return ret;