From 0d9c3c895cd2f38cfd1687ca6dc4bd7d31fa9415 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 22 Jan 2026 14:29:29 +0000 Subject: [PATCH] Stick the pragmas outside the function (make GCC 4 happier) and under __GNUC__. --- format.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/format.c b/format.c index d4af471d..d0090bc8 100644 --- a/format.c +++ b/format.c @@ -455,14 +455,18 @@ format_job_tidy(struct format_job_tree *jobs, int force) } /* Work around needless -Wformat-nonliteral gcc warning. */ +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" +#endif static size_t format_strftime(char *s, size_t max, const char *fmt, const struct tm *tm) { -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" return (strftime(s, max, fmt, tm)); -#pragma GCC diagnostic pop } +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif /* Tidy old jobs for all clients. */ void