summaryrefslogtreecommitdiff
path: root/watchfrr
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2023-01-26 14:53:47 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2023-01-27 12:01:20 +0100
commitc84e51870940311bb6ec67d8b192da1ce32cba8f (patch)
tree5d1c214da53ca54b575e0b9e7c66d3c2422b1751 /watchfrr
parent0f9de11a11644b77cc60d6ff6ac4519d2e5c29e1 (diff)
*: 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 <equinox@opensourcerouting.org>
Diffstat (limited to 'watchfrr')
-rw-r--r--watchfrr/watchfrr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/watchfrr/watchfrr.c b/watchfrr/watchfrr.c
index 4a3575ae75..f1cc84bc78 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);