diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2023-01-26 14:53:47 +0100 | 
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2023-01-27 12:01:20 +0100 | 
| commit | c84e51870940311bb6ec67d8b192da1ce32cba8f (patch) | |
| tree | 5d1c214da53ca54b575e0b9e7c66d3c2422b1751 /bgpd | |
| parent | 0f9de11a11644b77cc60d6ff6ac4519d2e5c29e1 (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 'bgpd')
| -rw-r--r-- | bgpd/bgp_dump.c | 4 | 
1 files changed, 4 insertions, 0 deletions
diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c index 254996edad..98a2f95ead 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__);  | 
