Fix compilation warnings (#15858)
* Fix compilation warnings * Fix adding compilation warnings when NETDATA_INTERNAL_CHECKS or NETDATA_DEV_MODE is specified
Stelios Fragkakis committed
Aug 21, 2023 at 21:59 UTC
e66072e0353ad9cd75a1298dd1d501485bbb1cd5
5 files changed
+20
-20
collectors/apps.plugin/apps_plugin.c
+11
-11
@@ -1457,17 +1457,17 @@ cleanup:
1457
netdata_log_info(
1458
"FDS_LIMITS: PID %d (%s) is using "
1459
"%0.2f %% of its fds limits, "
1460
- "open fds = %llu ("
1461
- "files = %llu, "
1462
- "pipes = %llu, "
1463
- "sockets = %llu, "
1464
- "inotifies = %llu, "
1465
- "eventfds = %llu, "
1466
- "timerfds = %llu, "
1467
- "signalfds = %llu, "
1468
- "eventpolls = %llu "
1469
- "other = %llu "
1470
- "), open fds limit = %llu, "
1460
+ "open fds = %"PRIu64 "("
1461
+ "files = %"PRIu64 ", "
1462
+ "pipes = %"PRIu64 ", "
1463
+ "sockets = %"PRIu64", "
1464
+ "inotifies = %"PRIu64", "
1465
+ "eventfds = %"PRIu64", "
1466
+ "timerfds = %"PRIu64", "
1467
+ "signalfds = %"PRIu64", "
1468
+ "eventpolls = %"PRIu64" "
1469
+ "other = %"PRIu64" "
1470
+ "), open fds limit = %"PRIu64", "
1471
"%s, "
1472
"original line [%s]",
1473
p->pid, p->comm, p->openfds_limits_percent, all_fds,
collectors/debugfs.plugin/sys_devices_virtual_powercap.c
+2
-2
@@ -186,7 +186,7 @@ int do_sys_devices_virtual_powercap(int update_every, const char *name __maybe_u
186
if(get_measurement(zone->path, &zone->energy_uj)) {
187
fprintf(stdout,
188
"BEGIN '%s'\n"
189
- "SET power = %lld\n"
189
+ "SET power = %llu\n"
190
"END\n"
191
, zone->zone_chart_id
192
, zone->energy_uj);
@@ -200,7 +200,7 @@ int do_sys_devices_virtual_powercap(int update_every, const char *name __maybe_u
200
for (struct zone_t *subzone = zone->subzones; subzone; subzone = subzone->next) {
201
if(get_measurement(subzone->path, &subzone->energy_uj)) {
202
fprintf(stdout,
203
- "SET '%s' = %lld\n",
203
+ "SET '%s' = %llu\n",
204
subzone->name,
205
subzone->energy_uj);
206
}
collectors/plugins.d/pluginsd_parser.c
+5
-5
@@ -764,12 +764,12 @@ static void inflight_functions_insert_callback(const DICTIONARY_ITEM *item, void
764
pf->sent_ut = now_realtime_usec();
765
766
if(ret < 0) {
767
- netdata_log_error("FUNCTION '%s': failed to send it to the plugin, error %d", string2str(pf->function), ret);
767
+ netdata_log_error("FUNCTION '%s': failed to send it to the plugin, error %zd", string2str(pf->function), ret);
768
rrd_call_function_error(pf->destination_wb, "Failed to communicate with collector", HTTP_RESP_SERVICE_UNAVAILABLE);
769
}
770
else {
771
internal_error(LOG_FUNCTIONS,
772
- "FUNCTION '%s' with transaction '%s' sent to collector (%d bytes, in %llu usec)",
772
+ "FUNCTION '%s' with transaction '%s' sent to collector (%zd bytes, in %llu usec)",
773
string2str(pf->function), dictionary_acquired_item_name(item), ret,
774
pf->sent_ut - pf->started_ut);
775
}
@@ -781,12 +781,12 @@ static void inflight_functions_insert_callback(const DICTIONARY_ITEM *item, void
781
ret = send_to_plugin(pf->payload, parser);
782
783
if(ret < 0) {
784
- netdata_log_error("FUNCTION_PAYLOAD '%s': failed to send function to plugin, error %d", string2str(pf->function), ret);
784
+ netdata_log_error("FUNCTION_PAYLOAD '%s': failed to send function to plugin, error %zd", string2str(pf->function), ret);
785
rrd_call_function_error(pf->destination_wb, "Failed to communicate with collector", HTTP_RESP_SERVICE_UNAVAILABLE);
786
}
787
else {
788
internal_error(LOG_FUNCTIONS,
789
- "FUNCTION_PAYLOAD '%s' with transaction '%s' sent to collector (%d bytes, in %llu usec)",
789
+ "FUNCTION_PAYLOAD '%s' with transaction '%s' sent to collector (%zd bytes, in %llu usec)",
790
string2str(pf->function), dictionary_acquired_item_name(item), ret,
791
pf->sent_ut - pf->started_ut);
792
}
@@ -1894,7 +1894,7 @@ struct mutex_cond {
1894
int rc;
1895
};
1896
1897
-static void virt_fnc_got_data_cb(BUFFER *wb, int code, void *callback_data)
1897
+static void virt_fnc_got_data_cb(BUFFER *wb __maybe_unused, int code, void *callback_data)
1898
{
1899
struct mutex_cond *ctx = callback_data;
1900
pthread_mutex_lock(&ctx->lock);
libnetdata/facets/facets.c
+1
-1
@@ -163,7 +163,7 @@ void facets_set_histogram(FACETS *facets, const char *chart, usec_t after_ut, us
163
facets->histogram.slots = (facets->histogram.before_ut - facets->histogram.after_ut) / facets->histogram.slot_width + 1;
164
}
165
166
-static inline void facets_histogram_update_value(FACETS *facets, FACET_KEY *k, FACET_VALUE *v, usec_t usec) {
166
+static inline void facets_histogram_update_value(FACETS *facets, FACET_KEY *k __maybe_unused, FACET_VALUE *v, usec_t usec) {
167
if(!facets->histogram.enabled)
168
return;
169
web/api/web_api_v2.c
+1
-1
@@ -663,7 +663,7 @@ static int web_client_api_request_v2_webrtc(RRDHOST *host __maybe_unused, struct
663
}
664
665
#define CONFIG_API_V2_URL "/api/v2/config"
666
-static int web_client_api_request_v2_config(RRDHOST *host __maybe_unused, struct web_client *w, char *query) {
666
+static int web_client_api_request_v2_config(RRDHOST *host __maybe_unused, struct web_client *w, char *query __maybe_unused) {
667
668
char *url = strdupz(buffer_tostring(w->url_as_received));
669
char *url_full = url;