changeset 30345:4bae8f3c0ac2

Avoid gcc warnings because of #pragma GCC system_header on older gcc.
author Bruno Haible <bruno@clisp.org>
date Sat, 18 Oct 2008 01:41:46 +0200
parents 202b27a5b8d3
children 3a2cbb16720d
files ChangeLog m4/include_next.m4
diffstat 2 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Oct 17 13:43:21 2008 +0200
+++ b/ChangeLog	Sat Oct 18 01:41:46 2008 +0200
@@ -1,3 +1,11 @@
+2008-10-17  Bruno Haible  <bruno@clisp.org>
+
+	Avoid gcc warnings because of #pragma GCC system_header on older gcc.
+	* m4/include_next.m4: Require autoconf >= 2.60.
+	(gl_INCLUDE_NEXT): Use #pragma GCC system_header only for GCC 3.0 or
+	newer.
+	Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
+
 2008-10-17  Jim Meyering  <meyering@redhat.com>
 
 	ignore-value: don't depend on inline module
--- a/m4/include_next.m4	Fri Oct 17 13:43:21 2008 +0200
+++ b/m4/include_next.m4	Sat Oct 18 01:41:46 2008 +0200
@@ -1,4 +1,4 @@
-# include_next.m4 serial 8
+# include_next.m4 serial 9
 dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,6 +6,8 @@
 
 dnl From Paul Eggert and Derek Price.
 
+AC_PREREQ([2.60])
+
 dnl Sets INCLUDE_NEXT and PRAGMA_SYSTEM_HEADER.
 dnl
 dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to
@@ -59,7 +61,10 @@
   if test $gl_cv_have_include_next = yes; then
     INCLUDE_NEXT=include_next
     if test -n "$GCC"; then
-      PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
+      dnl GCC 3.0 or newer supports #pragma GCC system_header.
+      PRAGMA_SYSTEM_HEADER='#if __GNUC__ >= 3
+#pragma GCC system_header
+#endif'
     fi
   else
     INCLUDE_NEXT=include