summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu.herrb@laas.fr>2014-02-09 11:20:59 +0100
committerKeith Packard <keithp@keithp.com>2014-02-24 16:30:07 -0800
commite67f2d7e0f9189beb2907fa06cff5ecc7f35f922 (patch)
treefd0412f0fb2c161925edb37e337ed6a94c3094f4 /os
parent1940508a4af33d44a7a8ef24bbdcd1e31e228dab (diff)
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>
Diffstat (limited to 'os')
-rw-r--r--os/log.c4
1 files changed, 4 insertions, 0 deletions
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");