[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strings.h in argz.c?
From: |
Simon Josefsson |
Subject: |
Re: strings.h in argz.c? |
Date: |
Wed, 03 Jan 2007 13:34:25 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.92 (gnu/linux) |
Hi! I have had a patch for argz.c sitting in my local gnulib tree for
a while, discussed on the bug-gnulib list some time ago. It seems as
if special string.h vs strings.h handling is not needed any more.
Argz is the only remaining module in gnulib which still includes the
header. See the discussion below.
Would you consider installing the patch below in libtool?
Thanks,
Simon
Simon Josefsson <address@hidden> writes:
> Bruno Haible <address@hidden> writes:
>
>> Simon Josefsson wrote:
>>> #if defined(HAVE_STRING_H)
>>> # include <string.h>
>>> #elif defined(HAVE_STRINGS_H)
>>> # include <strings.h>
>>> #endif
>>> #if defined(HAVE_MEMORY_H)
>>> # include <memory.h>
>>> #endif
>>>
>>> Is strings.h needed on any modern platform?
>>
>> No.
>> 1) <string.h> exists on all platforms, for several years now.
>> The #elif branch in the above code is therefore never executed.
>> 2) There are a few other functions defined in glibc <strings.h>, but they
>> are not useful. See
>> http://lists.gnu.org/archive/html/bug-gnulib/2006-10/msg00113.html
>
> I assume that memory.h is a side-effect of using strings.h, and that
> memory.h is not needed today either?
>
> I see that argz.c comes from libtool. Would this patch be acceptable?
> I'm cc:ing bug-libtool in case they have some legacy priority that
> demand strings.h.
>
> /Simon
Index: argz.c
===================================================================
RCS file: /sources/gnulib/gnulib/lib/argz.c,v
retrieving revision 1.8
diff -u -p -r1.8 argz.c
--- argz.c 24 Oct 2006 20:40:29 -0000 1.8
+++ argz.c 3 Jan 2007 12:33:47 -0000
@@ -32,15 +32,7 @@
#include <stdlib.h>
#include <sys/types.h>
#include <errno.h>
-
-#if defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#endif
-#if defined(HAVE_MEMORY_H)
-# include <memory.h>
-#endif
+#include <string.h>
#define EOS_CHAR '\0'