Stick the pragmas outside the function (make GCC 4 happier) and under __GNUC__.

This commit is contained in:
Nicholas Marriott
2026-01-22 14:29:29 +00:00
parent 6525bb7cef
commit 0d9c3c895c

View File

@@ -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