changeset 10655:8668b19a7032

Avoid gcc warnings because of #pragma GCC system_header on older gcc.
author Bruno Haible <bruno@clisp.org>
date Sat, 18 Oct 2008 02:43:18 +0200
parents c64ea4eea695
children 2d3e9948c077
files ChangeLog lib/arpa_inet.in.h lib/dirent.in.h lib/errno.in.h lib/fcntl.in.h lib/float.in.h lib/iconv.in.h lib/inttypes.in.h lib/locale.in.h lib/math.in.h lib/netdb.in.h lib/netinet_in.in.h lib/search.in.h lib/signal.in.h lib/spawn.in.h lib/stdarg.in.h lib/stdint.in.h lib/stdio.in.h lib/stdlib.in.h lib/string.in.h lib/strings.in.h lib/sys_file.in.h lib/sys_ioctl.in.h lib/sys_select.in.h lib/sys_socket.in.h lib/sys_stat.in.h lib/sys_time.in.h lib/sysexits.in.h lib/time.in.h lib/unistd.in.h lib/wchar.in.h lib/wctype.in.h m4/include_next.m4
diffstat 33 files changed, 96 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,38 @@
 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.
+	* lib/arpa_inet.in.h: Encloses reference to PRAGMA_SYSTEM_HEADER so
+	that it gets activated only for gcc >= 3.0.
+	* lib/dirent.in.h: Likewise.
+	* lib/errno.in.h: Likewise.
+	* lib/fcntl.in.h: Likewise.
+	* lib/float.in.h: Likewise.
+	* lib/iconv.in.h: Likewise.
+	* lib/inttypes.in.h: Likewise.
+	* lib/locale.in.h: Likewise.
+	* lib/math.in.h: Likewise.
+	* lib/netdb.in.h: Likewise.
+	* lib/netinet_in.in.h: Likewise.
+	* lib/search.in.h: Likewise.
+	* lib/signal.in.h: Likewise.
+	* lib/spawn.in.h: Likewise.
+	* lib/stdarg.in.h: Likewise.
+	* lib/stdint.in.h: Likewise.
+	* lib/stdio.in.h: Likewise.
+	* lib/stdlib.in.h: Likewise.
+	* lib/string.in.h: Likewise.
+	* lib/strings.in.h: Likewise.
+	* lib/sys_file.in.h: Likewise.
+	* lib/sys_ioctl.in.h: Likewise.
+	* lib/sys_select.in.h: Likewise.
+	* lib/sys_socket.in.h: Likewise.
+	* lib/sys_stat.in.h: Likewise.
+	* lib/sys_time.in.h: Likewise.
+	* lib/sysexits.in.h: Likewise.
+	* lib/time.in.h: Likewise.
+	* lib/unistd.in.h: Likewise.
+	* lib/wchar.in.h: Likewise.
+	* lib/wctype.in.h: Likewise.
 	Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
 
 2008-10-17  Jim Meyering  <meyering@redhat.com>
--- a/lib/arpa_inet.in.h
+++ b/lib/arpa_inet.in.h
@@ -24,7 +24,9 @@
 
 #if @HAVE_ARPA_INET_H@
 
+# if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+# endif
 
 /* The include_next requires a split double-inclusion guard.  */
 # @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@
--- a/lib/dirent.in.h
+++ b/lib/dirent.in.h
@@ -16,7 +16,9 @@
 
 #ifndef _GL_DIRENT_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_DIRENT_H@
--- a/lib/errno.in.h
+++ b/lib/errno.in.h
@@ -18,7 +18,9 @@
 
 #ifndef _GL_ERRNO_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_ERRNO_H@
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -17,7 +17,9 @@
 
 /* written by Paul Eggert */
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 #if defined __need_system_fcntl_h
 /* Special invocation convention.  */
--- a/lib/float.in.h
+++ b/lib/float.in.h
@@ -17,7 +17,9 @@
 
 #ifndef _GL_FLOAT_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_FLOAT_H@
--- a/lib/iconv.in.h
+++ b/lib/iconv.in.h
@@ -18,7 +18,9 @@
 
 #ifndef _GL_ICONV_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_ICONV_H@
--- a/lib/inttypes.in.h
+++ b/lib/inttypes.in.h
@@ -26,7 +26,9 @@
    The include_next requires a split double-inclusion guard.  */
 #if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 # if @HAVE_INTTYPES_H@
+#  if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#  endif
 #  @INCLUDE_NEXT@ @NEXT_INTTYPES_H@
 # endif
 #endif
--- a/lib/locale.in.h
+++ b/lib/locale.in.h
@@ -16,7 +16,9 @@
 
 #ifndef _GL_LOCALE_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_LOCALE_H@
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -17,7 +17,9 @@
 
 #ifndef _GL_MATH_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_MATH_H@
--- a/lib/netdb.in.h
+++ b/lib/netdb.in.h
@@ -24,7 +24,9 @@
 
 #if @HAVE_NETDB_H@
 
+# if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+# endif
 
 /* The include_next requires a split double-inclusion guard.  */
 # @INCLUDE_NEXT@ @NEXT_NETDB_H@
--- a/lib/netinet_in.in.h
+++ b/lib/netinet_in.in.h
@@ -19,7 +19,9 @@
 
 #if @HAVE_NETINET_IN_H@
 
+# if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+# endif
 
 /* On many platforms, <netinet/in.h> assumes prior inclusion of
    <sys/types.h>.  */
--- a/lib/search.in.h
+++ b/lib/search.in.h
@@ -19,7 +19,9 @@
 
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_SEARCH_H@
+# if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+# endif
 # @INCLUDE_NEXT@ @NEXT_SEARCH_H@
 #endif
 
--- a/lib/signal.in.h
+++ b/lib/signal.in.h
@@ -15,7 +15,9 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 #if defined __need_sig_atomic_t || defined __need_sigset_t
 /* Special invocation convention inside glibc header files.  */
--- a/lib/spawn.in.h
+++ b/lib/spawn.in.h
@@ -17,7 +17,9 @@
 
 #ifndef _GL_SPAWN_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_SPAWN_H@
--- a/lib/stdarg.in.h
+++ b/lib/stdarg.in.h
@@ -17,7 +17,9 @@
 
 #ifndef _GL_STDARG_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_STDARG_H@
--- a/lib/stdint.in.h
+++ b/lib/stdint.in.h
@@ -49,7 +49,9 @@
      in <inttypes.h> would reinclude us, skipping our contents because
      _GL_STDINT_H is defined.
      The include_next requires a split double-inclusion guard.  */
+# if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+# endif
 # @INCLUDE_NEXT@ @NEXT_STDINT_H@
 #endif
 
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -16,7 +16,9 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 #if defined __need_FILE || defined __need___FILE
 /* Special invocation convention inside glibc header files.  */
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -15,7 +15,9 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 #if defined __need_malloc_and_calloc
 /* Special invocation convention inside glibc header files.  */
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -18,7 +18,9 @@
 
 #ifndef _GL_STRING_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_STRING_H@
--- a/lib/strings.in.h
+++ b/lib/strings.in.h
@@ -18,7 +18,9 @@
 
 #ifndef _GL_STRINGS_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_STRINGS_H@
--- a/lib/sys_file.in.h
+++ b/lib/sys_file.in.h
@@ -19,7 +19,9 @@
 /* Written by Richard W.M. Jones.  */
 #ifndef _GL_SYS_FILE_H
 
+# if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+# endif
 
 /* The include_next requires a split double-inclusion guard.  */
 # if @HAVE_SYS_FILE_H@
--- a/lib/sys_ioctl.in.h
+++ b/lib/sys_ioctl.in.h
@@ -17,7 +17,9 @@
 
 #ifndef _GL_SYS_IOCTL_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_SYS_IOCTL_H@
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -19,7 +19,9 @@
 
 #if @HAVE_SYS_SELECT_H@
 
+# if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+# endif
 
 /* On many platforms, <sys/select.h> assumes prior inclusion of
    <sys/types.h>.  */
--- a/lib/sys_socket.in.h
+++ b/lib/sys_socket.in.h
@@ -27,7 +27,9 @@
 
 #if @HAVE_SYS_SOCKET_H@
 
+# if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+# endif
 
 /* On many platforms, <sys/socket.h> assumes prior inclusion of
    <sys/types.h>.  */
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -23,7 +23,9 @@
 
 #ifndef _GL_SYS_STAT_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
--- a/lib/sys_time.in.h
+++ b/lib/sys_time.in.h
@@ -18,7 +18,9 @@
 
 /* Written by Paul Eggert.  */
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 #if defined _GL_SYS_TIME_H
 
--- a/lib/sysexits.in.h
+++ b/lib/sysexits.in.h
@@ -20,7 +20,9 @@
 
 #if @HAVE_SYSEXITS_H@
 
+# if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+# endif
 
 /* IRIX 6.5 has an <unistd.h> that defines a macro EX_OK with a nonzero
    value.  Override it.  See
--- a/lib/time.in.h
+++ b/lib/time.in.h
@@ -16,7 +16,9 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* Don't get in the way of glibc when it includes time.h merely to
    declare a few standard symbols, rather than to declare all the
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -17,7 +17,9 @@
 
 #ifndef _GL_UNISTD_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_UNISTD_H@
--- a/lib/wchar.in.h
+++ b/lib/wchar.in.h
@@ -26,7 +26,9 @@
  * the declaration of wcwidth().
  */
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 #ifdef __need_mbstate_t
 /* Special invocation convention inside uClibc header files.  */
--- a/lib/wctype.in.h
+++ b/lib/wctype.in.h
@@ -28,7 +28,9 @@
 
 #ifndef _GL_WCTYPE_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 #if @HAVE_WINT_T@
 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
--- a/m4/include_next.m4
+++ b/m4/include_next.m4
@@ -1,4 +1,4 @@
-# include_next.m4 serial 9
+# include_next.m4 serial 8
 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,8 +6,6 @@
 
 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
@@ -61,10 +59,7 @@
   if test $gl_cv_have_include_next = yes; then
     INCLUDE_NEXT=include_next
     if test -n "$GCC"; then
-      dnl GCC 3.0 or newer supports #pragma GCC system_header.
-      PRAGMA_SYSTEM_HEADER='#if __GNUC__ >= 3
-#pragma GCC system_header
-#endif'
+      PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
     fi
   else
     INCLUDE_NEXT=include