diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | cpu.c | 4 | ||||
-rw-r--r-- | filesystem.c | 2 | ||||
-rw-r--r-- | hwmon.c | 2 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | meminfo.c | 2 | ||||
-rw-r--r-- | uname.c | 2 |
7 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile index e621c2f..4e4db4e 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ COLLECTORS += uname # compile settings -CFLAGS = -std=c11 -Os +CFLAGS = -std=c11 -Wall -Wextra -pedantic -Wno-format-truncation -Os LDFLAGS = -Os -s # build rules diff --git a/cpu.c b/cpu.c index 94dd4c5..4a058d7 100644 --- a/cpu.c +++ b/cpu.c @@ -26,6 +26,8 @@ struct cpu_context { }; void *cpu_init(int argc, char *argv[]) { + (void) argc; (void) argv; + long clock_tick = sysconf(_SC_CLK_TCK); if (clock_tick <= 0) { perror("sysconf(_SC_CLK_TCK)"); @@ -74,7 +76,7 @@ void cpu_collect(scrape_req *req, void *ctx_ptr) { char *at = buf + 3; char *sep = strchr(at, ' '); - if (!sep || sep - at + 1 > sizeof cpu_label) + if (!sep || sep - at + 1 > (ptrdiff_t) sizeof cpu_label) continue; *sep = '\0'; strcpy(cpu_label, at); diff --git a/filesystem.c b/filesystem.c index cbc98ff..d31518e 100644 --- a/filesystem.c +++ b/filesystem.c @@ -17,6 +17,8 @@ const struct collector filesystem_collector = { }; static void filesystem_collect(scrape_req *req, void *ctx) { + (void) ctx; + // buffers const char *labels[][2] = { // all filled by code diff --git a/hwmon.c b/hwmon.c index 4ec7b8a..feadb8f 100644 --- a/hwmon.c +++ b/hwmon.c @@ -167,6 +167,8 @@ static void hwmon_name(const char *path, char *dst, size_t dst_len) { } static void hwmon_collect(scrape_req *req, void *ctx) { + (void) ctx; + // buffers char chip_label[LABEL_SIZE]; diff --git a/main.c b/main.c index 9bfc8ea..34bf944 100644 --- a/main.c +++ b/main.c @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) { scrape_close(server); return 0; -}; +} static bool parse_args(int argc, char *argv[], struct config *cfg, struct handler_ctx *ctx) { for (size_t i = 0; i < NCOLLECTORS; i++) { diff --git a/meminfo.c b/meminfo.c index 52641d2..dae2b8c 100644 --- a/meminfo.c +++ b/meminfo.c @@ -26,6 +26,8 @@ const struct collector meminfo_collector = { }; static void meminfo_collect(scrape_req *req, void *ctx) { + (void) ctx; + // buffers char buf[BUF_SIZE] = METRIC_PREFIX; diff --git a/uname.c b/uname.c index 4fd4eac..e3cc682 100644 --- a/uname.c +++ b/uname.c @@ -28,6 +28,8 @@ struct uname_context { }; static void *uname_init(int argc, char *argv[]) { + (void) argc; (void) argv; + struct utsname name; if (uname(&name) == -1) { perror("uname"); |