[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GCC 4.4 at least for mips has no -Wsuggest-attribute=pure
From: |
Jim Meyering |
Subject: |
Re: GCC 4.4 at least for mips has no -Wsuggest-attribute=pure |
Date: |
Wed, 04 Apr 2012 13:33:55 +0200 |
Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Which makes compilation fail in regex.c on
> # if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
> # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
> # pragma GCC diagnostic ignored "-Wtype-limits"
> # endif
Thanks for the report.
Per http://gcc.gnu.org/gcc-4.6/changes.html
that option was added in 4.6, not 4.3.
I've pushed this:
>From d4cecf1ee37f6b611ef092c9c7fa3761d02ce2c3 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 4 Apr 2012 13:32:15 +0200
Subject: [PATCH] regex: correct #pragma guard expression
* lib/regex.c: -Wsuggest-attribute=pure was introduced in gcc-4.6,
not 4.3. Correct its cpp guard expression.
---
ChangeLog | 6 ++++++
lib/regex.c | 4 +++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 2f8eb0f..d41141c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-04-04 Jim Meyering <address@hidden>
+
+ regex: correct #pragma guard expression
+ * lib/regex.c: -Wsuggest-attribute=pure was introduced in gcc-4.6,
+ not 4.3. Correct its cpp guard expression.
+
2012-04-04 Paul Eggert <address@hidden>
regex: remove unnecessary type punning
diff --git a/lib/regex.c b/lib/regex.c
index a8e2341..ab27536 100644
--- a/lib/regex.c
+++ b/lib/regex.c
@@ -19,8 +19,10 @@
#ifndef _LIBC
# include <config.h>
-# if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
+# endif
+# if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
# pragma GCC diagnostic ignored "-Wtype-limits"
# endif
#endif
--
1.7.9.3