From f689c4ec1587507d87f2268eddbd6b50fc452c6c Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Thu, 9 May 2024 14:37:39 +0200 Subject: [PATCH] Fix compiler warnings - implicit declaration of built-in function 'strncpy' - control reaches end of non-void function - assignment to 'void (*)(int, siginfo_t *, void *)' from incompatible pointer type 'void (*)(int)' --- impl/src/jsonlogger.c | 3 +++ impl/test/test_jsonlogger.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/impl/src/jsonlogger.c b/impl/src/jsonlogger.c index d3c2de0..f0ac4c1 100644 --- a/impl/src/jsonlogger.c +++ b/impl/src/jsonlogger.c @@ -6,6 +6,7 @@ #include #include +#include #include "jsonlogger.h" @@ -81,6 +82,8 @@ static bool dump_var_array_cf(const var_array_cf_t *varray) } LOG_OR_RETURN("]"); + + return true; } diff --git a/impl/test/test_jsonlogger.c b/impl/test/test_jsonlogger.c index dee7ee7..36f1b28 100644 --- a/impl/test/test_jsonlogger.c +++ b/impl/test/test_jsonlogger.c @@ -45,9 +45,10 @@ int main() } // ignore SIGPIPE - term_action.sa_sigaction = SIG_IGN; - - if(sigaction(SIGPIPE, &term_action, NULL) < 0) { + struct sigaction term_action_ign = { + .sa_handler = SIG_IGN, + }; + if(sigaction(SIGPIPE, &term_action_ign, NULL) < 0) { perror("sigaction"); exit(EXIT_FAILURE); }