From 3c1abd57d5f45455ceaa7fa905f86c16e55aac15 Mon Sep 17 00:00:00 2001 From: nirenjan Date: Wed, 18 Mar 2026 22:25:26 -0700 Subject: [PATCH] fix(pinelog): Cleanup unused parameter warnings With a recent enough version, the compiler reports a number of unused parameter warnings when Meson is configured with `--warnlevel=3`. This commit addresses those warnings. --- subprojects/pinelog/bench_pinelog.c | 2 +- subprojects/pinelog/pinelog.c | 4 ++++ subprojects/pinelog/test_pinelog.c | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/subprojects/pinelog/bench_pinelog.c b/subprojects/pinelog/bench_pinelog.c index 419f61b..490cdc4 100644 --- a/subprojects/pinelog/bench_pinelog.c +++ b/subprojects/pinelog/bench_pinelog.c @@ -41,7 +41,7 @@ static void print_time_difference(const char *type, struct timespec *ts) type, tp_usec, tp_nsec, ret.tv_sec, ret.tv_nsec); } -int main(int argc, char **argv) +int main(void) { struct timespec ts_wall[2]; struct timespec ts_cpu[2]; diff --git a/subprojects/pinelog/pinelog.c b/subprojects/pinelog/pinelog.c index 8258044..54d876d 100644 --- a/subprojects/pinelog/pinelog.c +++ b/subprojects/pinelog/pinelog.c @@ -348,6 +348,10 @@ void pinelog_log_message(int module, int level, const char *file, int line, cons #else fprintf(output_stream, "%s:%d ", file, line); #endif + #else + // Suppress unused parameter warnings + (void)file; + (void)line; #endif /* Set the module name if it is not the root */ diff --git a/subprojects/pinelog/test_pinelog.c b/subprojects/pinelog/test_pinelog.c index 9faccb2..a34d9a1 100644 --- a/subprojects/pinelog/test_pinelog.c +++ b/subprojects/pinelog/test_pinelog.c @@ -36,6 +36,7 @@ static size_t expected_len; time_t time(time_t *p) { + (void)p; // Override the time function from libc return 1636671600; } @@ -196,7 +197,7 @@ static void tap_bailout(const char *msg) exit(1); } -int main(int argc, char **argv) +int main(void) { int fifo_fd[2]; int flags;