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