Gabriel Dos Reis <[EMAIL PROTECTED]> writes:

>   The file libiberty/xstrerror.c contains the following fragment
> 
>     #ifdef VMS
>     #include <errno.h>
>     #if !defined (__STRICT_ANSI__) && !defined (__HIDE_FORBIDDEN_NAMES)
>     extern char *strerror (int,...);
>     #define DONT_DECLARE_STRERROR
>     #endif
>     #endif  /* VMS */
> 
>     #ifndef DONT_DECLARE_STRERROR
>     extern char *strerror (int);
>     #endif
...

> Do you agree that the declaration could safely be replaced with a
> #include <string.h>?

Well, we require an ISO C90 compiler; do we require ISO C90 libraries?
If we require the libraries, then we can remove a number of files from
libiberty, at least atexit.c, memchr.c, memcmp.c, memcpy.c, memmove.c,
memset.c, snprintf.c, strchr.c, strerror.c, strncmp.c, strrchr.c,
strtol.c, strtoul.c, vfprintf.c, vsprintf.c.  If we don't require the
libraries, then we can't assume that <string.h> declares strerror.  In
fact, technically we can't even assume that <string.h> exists,
although we do currently have a few cases where it is included without
being protected by #ifdef HAVE_STRING_H.

I think the more conservative approach would be to simply add strerror
to AC_CHECK_DECLS, include <string.h> in xstrerror.c (protected by
HAVE_STRING_H), and protect the strerror declaration with
    #if !HAVE_DECL_STRERROR

Ian

Reply via email to