bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fpending issues on LSB


From: Paul Eggert
Subject: Re: fpending issues on LSB
Date: Wed, 27 Sep 2006 11:01:40 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

"Nelson H. F. Beebe" <address@hidden> writes:

> However, lsbcc has many of its own header files, including <stdio.h>,
> and it never includes <features.h>, and thus, never gets definitions
> of __BEGIN_DECLS and __END_DECLS.

If lsbcc replaces glibc stdio.h, it must do so compatibly with glibc;
otherwise a lot of glibc headers will break (not merely those using
stdio_ext.h).  glibc headers are not intended to be used one at a time
in an otherwise-only-POSIX system; you have to use glibc headers in an
overall system that is compatible with glibc.

I fear that there are a lot more porting problems where this one came
from.  But at the least I suppose you should file a bug report with
the lsbcc folks on this particular problem.  As things stand, programs
cannot use <stdio_ext.h> under lsbcc.

I installed the following patch into gnulib in an attempt to work
around this particular bug.  Can you verify whether it works for you?

2006-09-27  Paul Eggert  <address@hidden>

        * lib/__fpending.h: Don't include <stdio_ext.h> unless
        HAVE_DECL___FPENDING.  This avoids a bug with lsbcc, where
        it causes <stdio_ext.h> to cause a compile-time error.
        Problem reported by Nelson H. F. Beebe.
        * lib/getpass.c: Likewise, except for HAVE_DECL___FSETLOCKING instead
        of HAVE_DECL___PENDING.
        * m4/fpending.m4 (gl_FUNC_FPENDING): Check for stdio_ext at most once.
        * m4/getpass.m4 (gl_PREREQ_GETPASS): Check for __fsetlocking's
        declaration.

Index: lib/__fpending.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/__fpending.h,v
retrieving revision 1.6
diff -u -r1.6 __fpending.h
--- lib/__fpending.h    17 Aug 2006 20:34:21 -0000      1.6
+++ lib/__fpending.h    27 Sep 2006 17:59:05 -0000
@@ -1,6 +1,6 @@
 /* Declare __fpending.

-   Copyright (C) 2000, 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2003, 2005, 2006 Free Software Foundation, Inc.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -21,13 +21,14 @@
 #include <stddef.h>
 #include <stdio.h>

-#if HAVE_STDIO_EXT_H
-# include <stdio_ext.h>
-#endif
-
 #ifndef HAVE_DECL___FPENDING
 "this configure-time declaration test was not run"
 #endif
-#if !HAVE_DECL___FPENDING
+
+#if HAVE_DECL___FPENDING
+# if HAVE_STDIO_EXT_H
+#  include <stdio_ext.h>
+# endif
+#else
 size_t __fpending (FILE *);
 #endif
Index: lib/getpass.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/getpass.c,v
retrieving revision 1.17
diff -u -r1.17 getpass.c
--- lib/getpass.c       13 Sep 2006 22:38:14 -0000      1.17
+++ lib/getpass.c       27 Sep 2006 17:59:05 -0000
@@ -29,10 +29,11 @@

 #include <stdbool.h>

-#if HAVE_STDIO_EXT_H
-# include <stdio_ext.h>
-#endif
-#if !HAVE___FSETLOCKING
+#if HAVE_DECL___FSETLOCKING && HAVE___FSETLOCKING
+# if HAVE_STDIO_EXT_H
+#  include <stdio_ext.h>
+# endif
+#else
 # define __fsetlocking(stream, type)   /* empty */
 #endif

Index: m4/fpending.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/fpending.m4,v
retrieving revision 1.15
diff -u -r1.15 fpending.m4
--- m4/fpending.m4      21 Aug 2006 21:46:31 -0000      1.15
+++ m4/fpending.m4      27 Sep 2006 17:59:05 -0000
@@ -1,4 +1,4 @@
-#serial 9
+#serial 10

 # Copyright (C) 2000, 2001, 2004, 2005, 2006 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -15,7 +15,7 @@

 AC_DEFUN([gl_FUNC_FPENDING],
 [
-  AC_CHECK_HEADERS(stdio_ext.h)
+  AC_CHECK_HEADERS_ONCE(stdio_ext.h)
   AC_REPLACE_FUNCS([__fpending])
   fp_headers='
 #     include <stdio.h>
Index: m4/getpass.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/getpass.m4,v
retrieving revision 1.14
diff -u -r1.14 getpass.m4
--- m4/getpass.m4       21 Aug 2006 21:46:31 -0000      1.14
+++ m4/getpass.m4       27 Sep 2006 17:59:05 -0000
@@ -1,4 +1,4 @@
-# getpass.m4 serial 9
+# getpass.m4 serial 10
 dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -33,6 +33,11 @@
 AC_DEFUN([gl_PREREQ_GETPASS], [
   AC_CHECK_HEADERS_ONCE(stdio_ext.h termios.h)
   AC_CHECK_FUNCS_ONCE(__fsetlocking tcgetattr tcsetattr)
+  AC_CHECK_DECLS([__fsetlocking],,,
+    [#include <stdio.h>
+     #if HAVE_STDIO_EXT_H
+      #include <stdio_ext.h>
+     #endif])
   AC_CHECK_DECLS_ONCE([fflush_unlocked])
   AC_CHECK_DECLS_ONCE([flockfile])
   AC_CHECK_DECLS_ONCE([fputs_unlocked])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]