diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2023-01-31 09:01:32 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-31 09:01:32 -0500 |
| commit | ea768492f1499830292eec0a31b968e045d598f1 (patch) | |
| tree | 7c1319f14ca28f5fd7b5ef79bd259b0ec9a1db9e /lib/printf/vfprintf.c | |
| parent | d829de917876060ac3094b8bd651d8b84622cb87 (diff) | |
| parent | c2c6c55e8d677115abefb82567ab6ef9e7a07eb3 (diff) | |
Merge pull request #12695 from opensourcerouting/format-warnings
build: `-Wformat-nonliteral -Wformat-security`
Diffstat (limited to 'lib/printf/vfprintf.c')
| -rw-r--r-- | lib/printf/vfprintf.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/printf/vfprintf.c b/lib/printf/vfprintf.c index 49fa2b718f..cc886834fa 100644 --- a/lib/printf/vfprintf.c +++ b/lib/printf/vfprintf.c @@ -504,14 +504,20 @@ reswitch: switch (ch) { fmt[4] = ch; fmt[5] = '\0'; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" snprintf(buf, sizeof(buf), fmt, prec, arg); +#pragma GCC diagnostic pop } else { double arg = GETARG(double); char fmt[5] = "%.*"; fmt[3] = ch; fmt[4] = '\0'; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" snprintf(buf, sizeof(buf), fmt, prec, arg); +#pragma GCC diagnostic pop } cp = buf; /* for proper padding */ |
