Re: doc patch: typos in node "CVS Issues"

2007-05-16 Thread Bruno Haible
> 2007-05-16  Thien-Thi Nguyen  <[EMAIL PROTECTED]>  (tiny change)
> 
> * doc/gnulib-tool.texi (CVS Issues): Fix typo.

Thanks! Applied exactly as you sent it.

Bruno






problems with GCC 4.2.0 and coreutils with gnulib and system headers

2007-05-16 Thread Paul Eggert
Building coreutils with GCC 4.2.0 (under Debian stable) yields lots of
problems.  For example:

   gcc -std=gnu99  -I.  -g -O2 -MT savewd.o -MD -MP -MF .deps/savewd.Tpo -c 
-o savewd.o savewd.c
   In file included from ./sys/stat.h:27,
from ./fcntl.h:26,
from savewd.c:27:
   ///usr/include/sys/stat.h:365: warning: C99 inline functions are not 
supported; using GNU89
   ///usr/include/sys/stat.h:365: warning: to disable this warning use 
-fgnu89-inline or the gnu_inline function attribute

and there are lots more diagnostics like that.  The simplest fix I can
see is for gnulib foo.h to use "#include_next " when
#include_next is known to work.  This is what #include_next is for,
after all.

I installed the following patch to fix the problem for the modules I
help maintain, and will shortly email a followup patch for the
remaining modules.

2007-05-16  Paul Eggert  <[EMAIL PROTECTED]>

* lib/fcntl_.h: Prefer #include_next  to #include
@ABSOLUTE_FOO_H@ if @[EMAIL PROTECTED]  This works better with
GCC 4.2, which otherwise issues a lot of warnings.
* lib/inttypes_.h, lib/math_.h, lib/search_.h, lib/signal_.h:
* lib/stdint_.h, lib/stdio_.h, lib/stdlib_.h, lib/string_.h:
* lib/sys_time_.h, lib/time_.h, lib/wchar_.h, lib/wctype_.h: Likewise.
* lib/stdlib_.h: Don't bother with #pragma GCC system_header, as
it should no longer be needed.
* lib/string_.h: Likewise.
* modules/absolute-header (HAVE_INCLUDE_NEXT): New 'make' define.
* modules/fcntl (fcntl.h): Substitute @[EMAIL PROTECTED]
* modules/inttypes (inttypes.h): Likewise.
* modules/math (math.h): Likewise.
* modules/search (search.h): Likewise.
* modules/signal (signal.h): Likewise.
* modules/stdint (stdint.h): Likewise.
* modules/stdio (stdio.h): Likewise.
* modules/stdlib (stdlib.h): Likewise.
* modules/string (string.h): Likewise.
* modules/sys_time (sys/time.h): Likewise.
* modules/time (time.h): Likewise.
* modules/wchar (wchar.h): Likewise.
* modules/wctype (wtype.h): Likewise.

Index: lib/fcntl_.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/fcntl_.h,v
retrieving revision 1.3
diff -u -p -r1.3 fcntl_.h
--- lib/fcntl_.h14 Jan 2007 11:32:10 -  1.3
+++ lib/fcntl_.h17 May 2007 06:14:24 -
@@ -24,7 +24,11 @@
 #include 
 #include 
 #include 
-#include @ABSOLUTE_FCNTL_H@
+#if @HAVE_INCLUDE_NEXT@
+# include_next 
+#else
+# include @ABSOLUTE_FCNTL_H@
+#endif


 /* Declare overridden functions.  */
Index: lib/inttypes_.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/inttypes_.h,v
retrieving revision 1.10
diff -u -p -r1.10 inttypes_.h
--- lib/inttypes_.h 27 Apr 2007 11:09:11 -  1.10
+++ lib/inttypes_.h 17 May 2007 06:14:24 -
@@ -21,7 +21,7 @@
which in turn includes this file.  */
 #if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H
 # if @HAVE_INTTYPES_H@
-#  if defined __DECC && __DECC_VER >= 6000
+#  if @HAVE_INCLUDE_NEXT@
 #   include_next 
 #  else
 #   include @ABSOLUTE_INTTYPES_H@
Index: lib/math_.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/math_.h,v
retrieving revision 1.11
diff -u -p -r1.11 math_.h
--- lib/math_.h 27 Apr 2007 11:09:11 -  1.11
+++ lib/math_.h 17 May 2007 06:14:24 -
@@ -16,14 +16,14 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */

-#if defined __DECC && __DECC_VER >= 6000
+#if @HAVE_INCLUDE_NEXT@
 # include_next 
 #endif

 #ifndef _GL_MATH_H
 #define _GL_MATH_H

-#if !(defined __DECC && __DECC_VER >= 6000)
+#if ! @HAVE_INCLUDE_NEXT@
 # include @ABSOLUTE_MATH_H@
 #endif

Index: lib/search_.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/search_.h,v
retrieving revision 1.1
diff -u -p -r1.1 search_.h
--- lib/search_.h   25 Mar 2007 02:45:24 -  1.1
+++ lib/search_.h   17 May 2007 06:14:24 -
@@ -20,7 +20,11 @@
 #define _GL_SEARCH_H

 #if @HAVE_SEARCH_H@
-# include @ABSOLUTE_SEARCH_H@
+# if @HAVE_INCLUDE_NEXT@
+#  include_next 
+# else
+#  include @ABSOLUTE_SEARCH_H@
+# endif
 #endif


@@ -40,9 +44,9 @@ extern "C" {
for details.  */

 typedef enum
-{ 
+{
   preorder,
-  postorder, 
+  postorder,
   endorder,
   leaf
 }
Index: lib/signal_.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/signal_.h,v
retrieving revision 1.2
diff -u -p -r1.2 signal_.h
--- lib/signal_.h   1 May 2007 19:20:18 -   1.2
+++ lib/signal_.h   17 May 2007 06:14:24 -
@@ -19,7 +19,11 @@
 #if defined __need_sig_atomic_t || 

more #include_next patches for iconv_open, netinet_in, sys_stat, etc.

2007-05-16 Thread Paul Eggert
This is a followup to my previous message about using #include_next to
fix problems I'm having with GCC 4.2.0 on Debian stable.

Bruno, are the following #include_next patches to fchdir, iconv_open,
and locale OK with you?

Simon, are the following #include_next patches to netinet_in, sys_select,
sys_socket, sysexits, and unistd OK with you?

Eric, are the following #include_next patches to sys_stat OK with you?

2007-05-16  Paul Eggert  <[EMAIL PROTECTED]>

* lib/dirent_.h: Prefer #include_next  to #include
@ABSOLUTE_FOO_H@ if @[EMAIL PROTECTED]  This works better with
GCC 4.2, which otherwise issues a lot of warnings.
* lib/iconv_.h, lib/locale_.h, lib/netinet_in_.h, lib/sys_select_.h:
* lib/sys_socket_.h, lib/sys_stat_.h, lib/sysexits_.h, lib/unistd_.h:
Likewise.
* modules/fchdir (dirent.h): Substitute @[EMAIL PROTECTED]
* modules/iconv_open (iconv.h): Likewise.
* modules/locale (locale.h): Likewise.
* modules/netinet_in (netinet/in.h): Likewise.
* modules/sys_select (sys_select.h): Likewise.
* modules/sys_socket (sys/socket.h): Likewise.
* modules/sys_stat (sys/stat.h): Likewise.
* modules/sysexits (sysexits.h): Likewise.
* modules/unistd (unistd.h): Likewise.

Index: lib/dirent_.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/dirent_.h,v
retrieving revision 1.2
diff -u -p -r1.2 dirent_.h
--- lib/dirent_.h   19 Feb 2007 02:24:42 -  1.2
+++ lib/dirent_.h   17 May 2007 06:24:59 -
@@ -18,8 +18,11 @@
 #ifndef _GL_DIRENT_H
 #define _GL_DIRENT_H

-#include @ABSOLUTE_DIRENT_H@
-
+#if @HAVE_INCLUDE_NEXT@
+# include_next 
+#else
+# include @ABSOLUTE_DIRENT_H@
+#endif

 /* Declare overridden functions.  */

Index: lib/iconv_.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/iconv_.h,v
retrieving revision 1.1
diff -u -p -r1.1 iconv_.h
--- lib/iconv_.h31 Mar 2007 21:00:19 -  1.1
+++ lib/iconv_.h17 May 2007 06:24:59 -
@@ -19,8 +19,11 @@
 #ifndef _GL_ICONV_H
 #define _GL_ICONV_H

-#include @ABSOLUTE_ICONV_H@
-
+#if @HAVE_INCLUDE_NEXT@
+# include_next 
+#else
+# include @ABSOLUTE_ICONV_H@
+#endif

 #ifdef __cplusplus
 extern "C" {
Index: lib/locale_.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/locale_.h,v
retrieving revision 1.1
diff -u -p -r1.1 locale_.h
--- lib/locale_.h   10 Apr 2007 23:41:17 -  1.1
+++ lib/locale_.h   17 May 2007 06:24:59 -
@@ -18,7 +18,11 @@
 #ifndef _GL_LOCALE_H
 #define _GL_LOCALE_H

-#include @ABSOLUTE_LOCALE_H@
+#if @HAVE_INCLUDE_NEXT@
+# include_next 
+#else
+# include @ABSOLUTE_LOCALE_H@
+#endif

 /* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C.
On systems that don't define it, use the same value as GNU libintl.  */
Index: lib/netinet_in_.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/netinet_in_.h,v
retrieving revision 1.1
diff -u -p -r1.1 netinet_in_.h
--- lib/netinet_in_.h   7 Mar 2007 23:11:37 -   1.1
+++ lib/netinet_in_.h   17 May 2007 06:24:59 -
@@ -24,8 +24,11 @@
.  */

 # include 
-# include @ABSOLUTE_NETINET_IN_H@
-
+# if @HAVE_INCLUDE_NEXT@
+#  include_next 
+# else
+#  include @ABSOLUTE_NETINET_IN_H@
+# endif
 #else

 /* A platform that lacks .  */
Index: lib/sys_select_.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/sys_select_.h,v
retrieving revision 1.1
diff -u -p -r1.1 sys_select_.h
--- lib/sys_select_.h   7 Mar 2007 23:08:22 -   1.1
+++ lib/sys_select_.h   17 May 2007 06:24:59 -
@@ -24,7 +24,12 @@
.  */

 # include 
-# include @ABSOLUTE_SYS_SELECT_H@
+
+# if @HAVE_INCLUDE_NEXT@
+#  include_next 
+# else
+#  include @ABSOLUTE_SYS_SELECT_H@
+# endif

 #else

Index: lib/sys_socket_.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/sys_socket_.h,v
retrieving revision 1.1
diff -u -p -r1.1 sys_socket_.h
--- lib/sys_socket_.h   27 Apr 2007 18:19:55 -  1.1
+++ lib/sys_socket_.h   17 May 2007 06:24:59 -
@@ -30,7 +30,12 @@
.  */

 # include 
-# include @ABSOLUTE_SYS_SOCKET_H@
+
+# if @HAVE_INCLUDE_NEXT@
+#  include_next 
+# else
+#  include @ABSOLUTE_SYS_SOCKET_H@
+# endif

 #else

Index: lib/sys_stat_.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/sys_stat_.h,v
retrieving revision 1.2
diff -u -p -r1.2 sys_stat_.h
--- lib/sys_stat_.h 1 May 2007 18:14:44 -   1.2
+++ lib/sys_stat_.h 17 May 2007 06:24:59 -
@@ -23,7 +23,12 @@
 /* This file is supposed to be used on platforms where  is
incomplete.  It is intended to provide definitions and prototypes
needed by an application.  Start with what