From e67f2d7e0f9189beb2907fa06cff5ecc7f35f922 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Sun, 9 Feb 2014 11:20:59 +0100 Subject: gcc 4.2.1 doesn't support #pragma GCC diagnostic ignored Signed-off-by: Matthieu Herrb Signed-off-by: Keith Packard --- os/log.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'os') diff --git a/os/log.c b/os/log.c index 8deb81040..38193eed6 100644 --- a/os/log.c +++ b/os/log.c @@ -195,7 +195,9 @@ LogInit(const char *fname, const char *backup) char *logFileName = NULL; if (fname && *fname) { +#if __GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 2 #pragma GCC diagnostic ignored "-Wformat-nonliteral" +#endif if (asprintf(&logFileName, fname, display) == -1) FatalError("Cannot allocate space for the log file name\n"); @@ -206,7 +208,9 @@ LogInit(const char *fname, const char *backup) char *suffix; char *oldLog; +#if __GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 2 #pragma GCC diagnostic ignored "-Wformat-nonliteral" +#endif if ((asprintf(&suffix, backup, display) == -1) || (asprintf(&oldLog, "%s%s", logFileName, suffix) == -1)) FatalError("Cannot allocate space for the log file name\n"); -- cgit v1.2.3