bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH 2/2] Add missing argz_* functions from glibc


From: Jim Meyering
Subject: Re: [PATCH 2/2] Add missing argz_* functions from glibc
Date: Mon, 02 Jun 2008 14:00:28 +0200

Jim Meyering <address@hidden> wrote:
> Jim Meyering <address@hidden> wrote:
>
>> Ralf Wildenhues <address@hidden> wrote:
>>> Hi David,
>> ...
>>>> +                  err = __argz_append (&dst, &dst_len, src, (arg - src));
>>>
>>> Shouldn't this be argz_append?  How come you don't get a link error
>>> with this?
>>>
>>>> +                delayed_copy = 0;
>>>> +              }
>>>> +            if (! err)
>>>> +              err = __argz_add (&dst, &dst_len, to);
>>>
>>> Likewise, argz_add.
>>
>> These are compelling arguments for automatic derivation of
>> the file from the glibc sources.
>
> Wow.  There are many differences between libtool's argz.c and glibc's.
> I suppose it's been a long time since things have been synced.  Here's a
> script to generate argz.c from glibc's sources (this also appends the
> few missing functions):
>
> cat <<\EOF > argz-gen
> #!/bin/sh
> glibc_dir=/mirror/d/glibc
> f='
> append
> addsep
> ctsep
> insert
> next
> stringify
> count
> extract
> create
> delete
> replace
> '
> for i in $f; do
>   perl -pe 's/__(argz_|st|mem)/$1/g' $glibc_dir/string/argz-$i.c \
>     | perl -0x0 -pe 's,/\*(.|\n)+?\*/\n,,' \
>     | grep -vE '^(#include|INTDEF|weak_alias|libc_hidden_def)'
> done
> EOF
>
> Run it like this:
>
>   sh argz-gen > argz.c
>
> For now, I haven't considered what headers to include
> at the top, nor have I tried to emit a copyright comment
> in the result, but the existing ones should work fine.
> This is just to let us evaluate the differences.
>
>>From the looks of the commit logs for libtool/libltdl/argz.c,
> there have been no changes, other than regarding included headers,
> so there should be no need to push libtool-specific bug fixes
> back to glibc.

If I hear no objection soon, I will sync gnulib's argz.c
directly from glibc, using something like the above.
Then, gnulib and libtool can evolve separately, if needed.

However, I'd really like to hear that at least one owner of
an one argz-using project agrees with this approach.




reply via email to

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