From: Michael Tremer Date: Wed, 4 Oct 2023 17:10:28 +0000 (+0000) Subject: string: Silence a couple of format error warnings X-Git-Tag: 0.9.30~1547 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=448012a86abed9eafb39ba865ad7f079f43d6a38;p=pakfire.git string: Silence a couple of format error warnings Signed-off-by: Michael Tremer --- diff --git a/src/cli/lib/progressbar.c b/src/cli/lib/progressbar.c index e20ba10a5..eb07aed92 100644 --- a/src/cli/lib/progressbar.c +++ b/src/cli/lib/progressbar.c @@ -454,6 +454,8 @@ static int cli_progressbar_add_eta(struct cli_progressbar* p) { return cli_progressbar_add_widget(p, cli_progressbar_eta, NULL, 0, NULL); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" static int cli_progressbar_format_speed(char** s, double value) { const char* units[] = { "%4.0fB/s", @@ -512,6 +514,7 @@ static int __cli_progressbar_format_size(char* s, const size_t length, double va return 1; } +#pragma GCC diagnostic pop static const char* cli_progressbar_bytes_transferred(struct cli_progressbar* p, struct cli_progressbar_widget* widget, unsigned int width, void* data) { diff --git a/src/libpakfire/string.c b/src/libpakfire/string.c index 75262c019..1a26ae566 100644 --- a/src/libpakfire/string.c +++ b/src/libpakfire/string.c @@ -283,6 +283,8 @@ char* pakfire_string_join(char** list, const char* delim) { return string; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" int __pakfire_format_size(char* dst, size_t length, double value) { const char* units[] = { "%.0f ", @@ -361,6 +363,7 @@ int __pakfire_format_time(char* buffer, const size_t length, const time_t t) { return __pakfire_strftime(buffer, length, format, t); } +#pragma GCC diagnostic pop char* pakfire_string_format_interval(const time_t t) { char* buffer = NULL;