bug-gnulib
[Top][All Lists]
Advanced

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

Re: getline.h


From: Bruno Haible
Subject: Re: getline.h
Date: Wed, 22 Aug 2007 23:02:17 +0200
User-agent: KMail/1.5.4

Hi Eric,

Thanks for working on this, and for the unit tests. The patch - excluding
the one of getdelim.c - is nearly perfect. But I see three problems:

1) You define the shell variable HAVE_DECL_GETDELIM depending whether the
   function exists, not whether the function is declared. But for example
   BeOS has the function but not the declaration. In this case we want
   stdio.h to provide the declaration, but there is no need for the
   function.

> --- m4/getdelim.m4    22 Aug 2006 17:15:28 -0000      1.2
> +++ m4/getdelim.m4    22 Aug 2007 00:04:01 -0000
> @@ -19,6 +20,7 @@ AC_DEFUN([gl_FUNC_GETDELIM],
>  
>    if test $ac_cv_func_getdelim = no; then
>      gl_PREREQ_GETDELIM
> +    HAVE_DECL_GETDELIM=0
>    fi
>  ])
 
How about setting HAVE_DECL_GETDELIM depending on $ac_cv_have_decl_getdelim ?

2) Likewise for getline.

> --- m4/getline.m4     22 Aug 2006 17:15:28 -0000      1.18
> +++ m4/getline.m4     22 Aug 2007 00:04:01 -0000
> @@ -60,12 +62,12 @@ AC_DEFUN([gl_FUNC_GETLINE],
>      )])
>    fi
>  
> +  if test $ac_cv_func_getline = no; then
> +    HAVE_DECL_GETLINE=0
> +  fi
> +
>    if test $am_cv_func_working_getline = no; then

3) This fails to provide a declaration for the rpl_getline function
if @REPLACE_GETLINE@ && @HAVE_DECL_GETLINE@ (e.g. on all those systems
which have a getline function which does not work: Cygwin, IRIX).

> +#if @GNULIB_GETLINE@
> +# if @REPLACE_GETLINE@
> +#  undef getline
> +#  define getline rpl_getline
> +# endif
> +# if address@hidden@
> +  ...
> +  extern ssize_t getline (char **, size_t *, FILE *);

The last #if should be:
   # if @REPLACE_GETLINE@ || address@hidden@

(as for example for the snprintf function).

4) Would you mind adding documentation files doc/function/get{line,delim}.texi
(since POSIX is being extended)? Otherwise I can do it.

Bruno





reply via email to

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