From db00bfed62e796e3d104834951b79bfe7ba35fcb Mon Sep 17 00:00:00 2001 From: Yegor Yefremov Date: Thu, 27 Feb 2025 11:34:17 +0100 Subject: [PATCH 1/2] Resolve -Wstrict-prototypes warning --- error.c | 4 ++-- nc.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/error.c b/error.c index ac41849..6fd11ef 100644 --- a/error.c +++ b/error.c @@ -45,12 +45,12 @@ void set_error(const char *fmt, ...) va_end(ap); } -void clear_error() +void clear_error(void) { last_error[0] = 0x00; } -char * get_error() +char * get_error(void) { return last_error; } diff --git a/nc.c b/nc.c index 3c92196..80f8812 100644 --- a/nc.c +++ b/nc.c @@ -463,7 +463,7 @@ void draw_rad_column(WINDOW *win, int x, double val) } } -double get_cur_scc() +double get_cur_scc(void) { double scc_val = 0.0; double prev_val = 0.0, u0 = 0.0; @@ -593,7 +593,7 @@ void draw_fft(void) } #endif -double calc_trend() +double calc_trend(void) { int half = history_n / 2, index = 0; double v1 = 0.0, v2 = 0.0; @@ -626,7 +626,7 @@ double calc_trend() return (v1 - v2) / (v2 / 100.0); } -void draw_graph() +void draw_graph(void) { int index = 0, loop_n = min(max_x, history_n), n = 0, n2 = 0; double avg = 0, sd = 0; From a826570b4a3a84fbd03f70b6b0840d3849486c86 Mon Sep 17 00:00:00 2001 From: Yegor Yefremov Date: Thu, 27 Feb 2025 14:30:51 +0100 Subject: [PATCH 2/2] CMakeLists.txt: handle -Wstrict-prototypes warnings as an error --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ad17fbf..a5e8c1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,7 @@ option(USE_GETTEXT "Enable interantionalization" OFF) add_compile_options(-Wall -pedantic -Wextra) add_compile_options(-Werror=unused-label) add_compile_options(-Werror=unused-parameter) +add_compile_options(-Werror=strict-prototypes) set(SOURCES colors.c