[Top][All Lists]
[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: |
Sat, 31 May 2008 19:58:42 +0200 |
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.
- [PATCH 0/2] Add missing functions to argz, David Lutterkort, 2008/05/28
- [PATCH 2/2] Add missing argz_* functions from glibc, David Lutterkort, 2008/05/28
- Re: [PATCH 2/2] Add missing argz_* functions from glibc, Ralf Wildenhues, 2008/05/29
- Re: [PATCH 2/2] Add missing argz_* functions from glibc, David Lutterkort, 2008/05/29
- Re: [PATCH 2/2, updated] Add missing argz_* functions from glibc, David Lutterkort, 2008/05/29
- Re: [PATCH 2/2] Add missing argz_* functions from glibc, Bob Friesenhahn, 2008/05/29
[PATCH 1/2] Make stpcpy LGPLv2+, David Lutterkort, 2008/05/28
Re: [PATCH 0/2] Add missing functions to argz, Eric Blake, 2008/05/28