From c84e51870940311bb6ec67d8b192da1ce32cba8f Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 26 Jan 2023 14:53:47 +0100 Subject: *: no-warn pragmas for non-const format strings We do use non-constant/literal format strings in a few places for more or less valid reasons; put `ignored "-Wformat-nonliteral"` around those so we can have the warning enabled for everywhere else. Signed-off-by: David Lamparter --- watchfrr/watchfrr.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'watchfrr') diff --git a/watchfrr/watchfrr.c b/watchfrr/watchfrr.c index 4a3575ae7..f1cc84bc7 100644 --- a/watchfrr/watchfrr.c +++ b/watchfrr/watchfrr.c @@ -512,7 +512,11 @@ static int run_job(struct restart_info *restart, const char *cmdtype, restart->kills = 0; { char cmd[strlen(command) + strlen(restart->name) + 1]; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" + /* user supplied command string has a %s for the daemon name */ snprintf(cmd, sizeof(cmd), command, restart->name); +#pragma GCC diagnostic pop if ((restart->pid = run_background(cmd)) > 0) { thread_add_timer(master, restart_kill, restart, gs.restart_timeout, &restart->t_kill); -- cgit v1.2.3