From: Bruno Haible Date: Sat, 18 Oct 2008 00:43:18 +0000 (+0200) Subject: Avoid gcc warnings because of #pragma GCC system_header on older gcc. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c08dcc35ce66a98261584beea4c5006fa28ca9b;p=pspp Avoid gcc warnings because of #pragma GCC system_header on older gcc. --- diff --git a/ChangeLog b/ChangeLog index 4e10e2a8ae..8bb49e2884 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 8d85749e07..54daf84370 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 494d71abb7..36dedf5ddb 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 df2dab099a..eef3931f9c 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 761e853153..af86c83222 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 8278041643..9ba2bce4b5 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 a5f9c01acf..096bf9c4cf 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 abce3bc1ca..bd9d0d2475 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 efbe08f262..10629f6c79 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 3ffb1774b4..b7f70b58bd 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 9a637f28f4..f4c2551ced 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 e01b366629..82aefb4992 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 0114b46806..62937c760a 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 4df1567c92..62e2b778d1 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 6976dade27..d67b766ed8 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 9d8b0c4fb9..976005c0c3 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 4fc3287752..97c98bf328 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 2ed82fe702..0e12d94530 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 a55c333035..f10d462321 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 c8845671ba..7d508ccdf5 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 50470943dc..0c87af2108 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 c1d2315c0d..a16eea0833 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 221177a3ce..44b0f8516a 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 b9d08b5c7f..2d20427839 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 1422faeffb..b703200088 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 7d0a1117f5..6226544762 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 e7c092ab83..439d3bb239 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 14b0b364d9..73da88db72 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 bb3bd01bf5..fba8fce074 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 8b4facbd47..2ffca21458 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 606a70a1c7..ceb62084f0 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 e3ed3679e8..8b33d7134f 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 91ecbb0965..b6e4d3ae7a 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