This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Convert old prototype.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 10 Jun 2013 14:34:15 +0200
- Subject: Re: [PATCH] Convert old prototype.
- References: <20130608104926 dot GA17305 at domone dot kolej dot mff dot cuni dot cz> <Pine dot LNX dot 4 dot 64 dot 1306081501490 dot 31181 at digraph dot polyomino dot org dot uk>
On Sat, Jun 08, 2013 at 03:15:37PM +0000, Joseph S. Myers wrote:
> On Sat, 8 Jun 2013, Ondrej Bilka wrote:
>
> > Continuing cleanup we now focus on converting old prototype to new.
> >
> > I now have patch that does formating rigth, see:
> >
> > http://kam.mff.cuni.cz/~ondra/convert_old_prototype.patch
> >
> > It could be applied as it is but it is not exhaustive as I needed
> > to exclude several special cases like macro to modify function name.
>
> Being non-exhaustive is fine. It's best to try to deal with the simple
> cases first and then deal with the trickier ones separately in smaller
> patches, possibly by hand, rather than trying to make one patch cover
> everything.
>
I now ran my program based on gcc warnings.
I uploaded new version there.
http://kam.mff.cuni.cz/~ondra/convert_old_prototype.patch
It passes tests but generated code is not same. I did not manage to
narrow down what causes difference to specific piece, more below.
This patch fixes plural.y prototype.
It converts prototypes except:
Functions with LOCALE_PARAM_DECL, This macro needs to be put to common
file.
openat Needs to add ...
sunrpc/* I do not know if it is worth effort.
Testcase and platform specific files that were not compiled by gcc.
When pattern below is present, it needs be done manualy.
type param1, param;
An list of files with this is:
locale/programs/xmalloc.c:85 fix size_t n, s
sunrpc/xdr.c:684 fix const struct xdr_discrim *choices; /* [value, xdr proc] for each arm *
string/memcmp.c:92 fix op_t a, b
inet/inet_mkadr.c:43 fix in_addr_t net, host
resolv/res_debug.c:310 fix const u_char *cp, *msg
math/w_dremf.c:12 fix float x, y
misc/efgcvt.c:67 fix int ndigit, *decpt, *sign
crypt/crypt_util.c:789 fix ufc_long v1, v2
posix/glob.c:253 fix int (*errfunc) (const char *, int)
crypt/crypt.c:85 fix ufc_long itr, *res
dirent/scandirat.c:55 fix int (*cmp) (const DIRENT_TYPE **, const DIRENT_TYPE **)
misc/daemon.c:44 fix int nochdir, noclose
math/w_drem.c:11 fix double x, y
inet/rcmd.c:106 fix const char *locuser, *remuser, *cmd
sunrpc/pmap_rmt.c:67 fix u_long prog, vers, proc
posix/regexec.c:308 fix int length, start
malloc/mtrace.c:248 fix size_t alignment, size
math/w_dreml.c:13 fix long double x, y
sunrpc/svc_udp.c:121 fix u_int sendsz, recvsz
misc/efgcvt_r.c:74 fix int ndigit, *decpt, *sign
io/fts.c:88 fix int (*compar) (const FTSENT **, const FTSENT **)
inet/rexec.c:52 fix const char *name, *pass, *cmd
inet/ruserpass.c:97 fix const char *host, **aname, **apass
intl/l10nflist.c:162 fix territory, codeset, normalized_codeset, modifier
stdlib/div.c:54 fix int numer, denom
dirent/scandir.c:37 fix int (*cmp) (const DIRENT_TYPE **, const DIRENT_TYPE **)
I tried to find inconsistencies by
for I in `find -regex ".*\.o"`;
do objdump -d $I > a;
more +4 a > c;
objdump -d ../test2/$I > b ;
more +4 b > d;
if [ -z "`diff c d`" ]; then
true;
else
echo $I;fi;
done > diff
This got lot of files, when I looked at diff it is similiar to following
and I did not found nothing wrong in nptl/pthread_mutex_timedlock.c
source.
--- a 2013-06-10 10:14:36.474059789 +0200
+++ b 2013-06-10 10:14:45.177216891 +0200
@@ -1,5 +1,5 @@
-../test1/nptl/pthread_mutex_timedlock.o: file format elf64-x86-64
+../test2/nptl/pthread_mutex_timedlock.o: file format elf64-x86-64
Disassembly of section .text:
@@ -394,7 +394,7 @@
623: 85 c0 test %eax,%eax
625: 0f 84 e3 fb ff ff je 20e <pthread_mutex_timedlock+0x20e>
62b: b9 00 00 00 00 mov $0x0,%ecx
- 630: ba da 01 00 00 mov $0x1da,%edx
+ 630: ba d9 01 00 00 mov $0x1d9,%edx
635: be 00 00 00 00 mov $0x0,%esi
63a: bf 00 00 00 00 mov $0x0,%edi
63f: e8 00 00 00 00 callq 644 <pthread_mutex_timedlock+0x644>
@@ -503,17 +503,17 @@
81e: 45 85 c0 test %r8d,%r8d
821: 0f 84 c4 fb ff ff je 3eb <pthread_mutex_timedlock+0x3eb>
827: b9 00 00 00 00 mov $0x0,%ecx
- 82c: ba 1f 01 00 00 mov $0x11f,%edx
+ 82c: ba 1e 01 00 00 mov $0x11e,%edx
831: be 00 00 00 00 mov $0x0,%esi
836: bf 00 00 00 00 mov $0x0,%edi
83b: e8 00 00 00 00 callq 840 <pthread_mutex_timedlock+0x840>
840: b9 00 00 00 00 mov $0x0,%ecx
- 845: ba 1b 01 00 00 mov $0x11b,%edx
+ 845: ba 1a 01 00 00 mov $0x11a,%edx
84a: be 00 00 00 00 mov $0x0,%esi
84f: bf 00 00 00 00 mov $0x0,%edi
854: e8 00 00 00 00 callq 859 <pthread_mutex_timedlock+0x859>
859: b9 00 00 00 00 mov $0x0,%ecx
- 85e: ba 3b 01 00 00 mov $0x13b,%edx
+ 85e: ba 3a 01 00 00 mov $0x13a,%edx
863: be 00 00 00 00 mov $0x0,%esi
868: bf 00 00 00 00 mov $0x0,%edi
86d: e8 00 00 00 00 callq 872 <pthread_mutex_timedlock+0x872>