summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_dump.c
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 /bgpd/bgp_dump.c
parent*: apply proper format string attributes (diff)
downloadfrr-c84e51870940311bb6ec67d8b192da1ce32cba8f.tar.xz
frr-c84e51870940311bb6ec67d8b192da1ce32cba8f.zip
*: 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 'bgpd/bgp_dump.c')
-rw-r--r--bgpd/bgp_dump.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c
index 254996eda..98a2f95ea 100644
--- a/bgpd/bgp_dump.c
+++ b/bgpd/bgp_dump.c
@@ -117,9 +117,13 @@ static FILE *bgp_dump_open_file(struct bgp_dump *bgp_dump)
if (bgp_dump->filename[0] != DIRECTORY_SEP) {
snprintf(fullpath, sizeof(fullpath), "%s/%s", vty_get_cwd(),
bgp_dump->filename);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+ /* user supplied date/time format string */
ret = strftime(realpath, MAXPATHLEN, fullpath, &tm);
} else
ret = strftime(realpath, MAXPATHLEN, bgp_dump->filename, &tm);
+#pragma GCC diagnostic pop
if (ret == 0) {
flog_warn(EC_BGP_DUMP, "%s: strftime error", __func__);