fix compiler warnings (#16665)
fix compiler warning when compiled without internal checks
Costa Tsaousis committed
Dec 24, 2023 at 13:34 UTC
635fdf8e3b2e3015ef2bb23fc0ab5ea63b447430
3 files changed
+5
-3
cli/cli.c
+1
-1
@@ -4,7 +4,7 @@
4
#include "daemon/common.h"
5
#include "libnetdata/required_dummies.h"
6
7
-void netdata_logger(ND_LOG_SOURCES source, ND_LOG_FIELD_PRIORITY priority, const char *file, const char *function, unsigned long line, const char *fmt, ... ) {
7
+void netdata_logger(ND_LOG_SOURCES source __maybe_unused, ND_LOG_FIELD_PRIORITY priority __maybe_unused, const char *file __maybe_unused, const char *function __maybe_unused, unsigned long line __maybe_unused, const char *fmt, ... ) {
8
va_list args;
9
va_start(args, fmt);
10
vfprintf(stderr, fmt, args );
collectors/plugins.d/pluginsd_parser.c
+3
-1
@@ -1375,8 +1375,10 @@ PARSER_RC parser_execute(PARSER *parser, PARSER_KEYWORD *keyword, char **words,
1375
return pluginsd_delete_job(words, num_words, parser);
1376
1377
default:
1378
- fatal("Unknown keyword '%s' with id %zu", keyword->keyword, keyword->id);
1378
+ break;
1379
}
1380
+
1381
+ fatal("Unknown keyword '%s' with id %zu", keyword->keyword, keyword->id);
1382
}
1383
1384
#include "gperf-hashtable.h"
libnetdata/buffer/buffer.h
+1
-1
@@ -107,7 +107,7 @@ typedef struct web_buffer {
107
#define buffer_overflow_check(b)
108
#endif
109
110
-static inline void _buffer_overflow_check(BUFFER *b) {
110
+static inline void _buffer_overflow_check(BUFFER *b __maybe_unused) {
111
assert(b->len <= b->size &&
112
"BUFFER: length is above buffer size.");
113