[PATCH] gcc 4.2.1 doesn't support #pragma GCC diagnostic ignored

Matthieu Herrb matthieu.herrb at laas.fr
Sun Feb 9 02:20:59 PST 2014


Signed-off-by: Matthieu Herrb <matthieu at herrb.eu>
---
 os/log.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git os/log.c os/log.c
index 8deb810..38193ee 100644
--- os/log.c
+++ 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");
-- 
1.8.5.3



More information about the xorg-devel mailing list