gcc 4.2.1 doesn't support #pragma GCC diagnostic ignored

Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Matthieu Herrb 2014-02-09 11:20:59 +01:00 committed by Keith Packard
parent 1940508a4a
commit e67f2d7e0f

View File

@ -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");