From 3c08dcc35ce66a98261584beea4c5006fa28ca9b Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 18 Oct 2008 02:43:18 +0200 Subject: [PATCH] Avoid gcc warnings because of #pragma GCC system_header on older gcc. --- ChangeLog | 35 ++++++++++++++++++++++++++++++++--- lib/arpa_inet.in.h | 2 ++ lib/dirent.in.h | 2 ++ lib/errno.in.h | 2 ++ lib/fcntl.in.h | 2 ++ lib/float.in.h | 2 ++ lib/iconv.in.h | 2 ++ lib/inttypes.in.h | 2 ++ lib/locale.in.h | 2 ++ lib/math.in.h | 2 ++ lib/netdb.in.h | 2 ++ lib/netinet_in.in.h | 2 ++ lib/search.in.h | 2 ++ lib/signal.in.h | 2 ++ lib/spawn.in.h | 2 ++ lib/stdarg.in.h | 2 ++ lib/stdint.in.h | 2 ++ lib/stdio.in.h | 2 ++ lib/stdlib.in.h | 2 ++ lib/string.in.h | 2 ++ lib/strings.in.h | 2 ++ lib/sys_file.in.h | 2 ++ lib/sys_ioctl.in.h | 2 ++ lib/sys_select.in.h | 2 ++ lib/sys_socket.in.h | 2 ++ lib/sys_stat.in.h | 2 ++ lib/sys_time.in.h | 2 ++ lib/sysexits.in.h | 2 ++ lib/time.in.h | 2 ++ lib/unistd.in.h | 2 ++ lib/wchar.in.h | 2 ++ lib/wctype.in.h | 2 ++ m4/include_next.m4 | 9 ++------- 33 files changed, 96 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4e10e2a8a..8bb49e288 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,38 @@ 2008-10-17 Bruno Haible 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 . 2008-10-17 Jim Meyering diff --git a/lib/arpa_inet.in.h b/lib/arpa_inet.in.h index 8d85749e0..54daf8437 100644 --- 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@ diff --git a/lib/dirent.in.h b/lib/dirent.in.h index 494d71abb..36dedf5dd 100644 --- 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@ diff --git a/lib/errno.in.h b/lib/errno.in.h index df2dab099..eef3931f9 100644 --- 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@ diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index 761e85315..af86c8322 100644 --- 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. */ diff --git a/lib/float.in.h b/lib/float.in.h index 827804164..9ba2bce4b 100644 --- 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@ diff --git a/lib/iconv.in.h b/lib/iconv.in.h index a5f9c01ac..096bf9c4c 100644 --- 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@ diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h index abce3bc1c..bd9d0d247 100644 --- 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 diff --git a/lib/locale.in.h b/lib/locale.in.h index efbe08f26..10629f6c7 100644 --- 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@ diff --git a/lib/math.in.h b/lib/math.in.h index 3ffb1774b..b7f70b58b 100644 --- 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@ diff --git a/lib/netdb.in.h b/lib/netdb.in.h index 9a637f28f..f4c2551ce 100644 --- 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@ diff --git a/lib/netinet_in.in.h b/lib/netinet_in.in.h index e01b36662..82aefb499 100644 --- 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, assumes prior inclusion of . */ diff --git a/lib/search.in.h b/lib/search.in.h index 0114b4680..62937c760 100644 --- 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 diff --git a/lib/signal.in.h b/lib/signal.in.h index 4df1567c9..62e2b778d 100644 --- 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 . */ +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif #if defined __need_sig_atomic_t || defined __need_sigset_t /* Special invocation convention inside glibc header files. */ diff --git a/lib/spawn.in.h b/lib/spawn.in.h index 6976dade2..d67b766ed 100644 --- 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@ diff --git a/lib/stdarg.in.h b/lib/stdarg.in.h index 9d8b0c4fb..976005c0c 100644 --- 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@ diff --git a/lib/stdint.in.h b/lib/stdint.in.h index 4fc328775..97c98bf32 100644 --- a/lib/stdint.in.h +++ b/lib/stdint.in.h @@ -49,7 +49,9 @@ in 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 diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 2ed82fe70..0e12d9453 100644 --- 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. */ diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index a55c33303..f10d46232 100644 --- 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 . */ +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif #if defined __need_malloc_and_calloc /* Special invocation convention inside glibc header files. */ diff --git a/lib/string.in.h b/lib/string.in.h index c8845671b..7d508ccdf 100644 --- 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@ diff --git a/lib/strings.in.h b/lib/strings.in.h index 50470943d..0c87af210 100644 --- 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@ diff --git a/lib/sys_file.in.h b/lib/sys_file.in.h index c1d2315c0..a16eea083 100644 --- 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@ diff --git a/lib/sys_ioctl.in.h b/lib/sys_ioctl.in.h index 221177a3c..44b0f8516 100644 --- 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@ diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h index b9d08b5c7..2d2042783 100644 --- 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, assumes prior inclusion of . */ diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h index 1422faeff..b70320008 100644 --- 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, assumes prior inclusion of . */ diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h index 7d0a1117f..622654476 100644 --- 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@ diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h index e7c092ab8..439d3bb23 100644 --- 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 diff --git a/lib/sysexits.in.h b/lib/sysexits.in.h index 14b0b364d..73da88db7 100644 --- 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 that defines a macro EX_OK with a nonzero value. Override it. See diff --git a/lib/time.in.h b/lib/time.in.h index bb3bd01bf..fba8fce07 100644 --- 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 diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 8b4facbd4..2ffca2145 100644 --- 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@ diff --git a/lib/wchar.in.h b/lib/wchar.in.h index 606a70a1c..ceb62084f 100644 --- 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. */ diff --git a/lib/wctype.in.h b/lib/wctype.in.h index e3ed3679e..8b33d7134 100644 --- 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: must be included before . diff --git a/m4/include_next.m4 b/m4/include_next.m4 index 91ecbb096..b6e4d3ae7 100644 --- 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 with or without modifications, as long as this notice is preserved. 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 @@ EOF 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 -- 2.11.0