summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-01-03 10:25:37 +0100
committerJim Meyering <meyering@redhat.com>2012-01-03 10:26:58 +0100
commit082f0d1a771a2febcc14ffce13f44ed7c4553ad4 (patch)
tree2631c619c39f69b1ebcd2783d4194671d66e70ab /lib
parenta00ff6423cab863c05f18cbac38abc51afe9d657 (diff)
downloadgrep-082f0d1a771a2febcc14ffce13f44ed7c4553ad4.tar.gz
build: avoid build failure with --enable-gcc-warnings and recent gcc
* lib/colorize-posix.c: Disable -Wsuggest-attribute=const, to avoid warning about this empty init_colorize function.
Diffstat (limited to 'lib')
-rw-r--r--lib/colorize-posix.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/colorize-posix.c b/lib/colorize-posix.c
index 37bc6400..116bbb2c 100644
--- a/lib/colorize-posix.c
+++ b/lib/colorize-posix.c
@@ -16,6 +16,12 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
+/* Without this pragma, gcc 4.7.0 20120102 suggests that the
+ init_colorize function might be candidate for attribute 'const' */
+#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
+#endif
+
#include <config.h>
#include "colorize.h"