From: Felix Fietkau Date: Sun, 20 Oct 2024 19:07:11 +0000 (+0200) Subject: main: fix format string related warnings for log/debug printf functions X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e93f6c3fc72904c0d178c9cdd57323071ef4ce12;p=project%2Fnetifd.git main: fix format string related warnings for log/debug printf functions Signed-off-by: Felix Fietkau --- diff --git a/main.c b/main.c index 4c4b1ff..ac0fcfe 100644 --- a/main.c +++ b/main.c @@ -89,7 +89,7 @@ netifd_delete_process(struct netifd_process *proc) close(proc->log.fd.fd); } -static void +static void __attribute__((format (printf, 1, 0))) netifd_udebug_vprintf(const char *format, va_list ap) { if (!udebug_buf_valid(&udb_log)) diff --git a/netifd.h b/netifd.h index a462abd..0c0537f 100644 --- a/netifd.h +++ b/netifd.h @@ -100,10 +100,12 @@ struct netifd_process { bool log_overflow; }; -void netifd_udebug_printf(const char *format, ...); +void netifd_udebug_printf(const char *format, ...) + __attribute__((format (printf, 1, 2))); void netifd_udebug_config(struct udebug_ubus *ctx, struct blob_attr *data, bool enabled); -void netifd_log_message(int priority, const char *format, ...); +void netifd_log_message(int priority, const char *format, ...) + __attribute__((format (printf, 2, 3))); int netifd_start_process(const char **argv, char **env, struct netifd_process *proc); void netifd_kill_process(struct netifd_process *proc);