From: Michal N. <mn...@re...> - 2009-01-21 17:13:38
|
Hi. Yet another clean-up patch. Compiling on i386 gave me following warnings: [...] strace.c: In function ‘handle_stopped_tcbs’: strace.c:2539: warning: passing argument 4 of ‘ptrace’ makes integer from pointer without a cast strace.c:2566: warning: passing argument 4 of ‘ptrace’ makes integer from pointer without a cast [...] util.c: In function ‘do_ptrace’: util.c:260: warning: passing argument 4 of ‘ptrace’ makes integer from pointer without a cast util.c: In function ‘ptrace_restart’: util.c:282: warning: passing argument 4 of ‘ptrace’ makes integer from pointer without a cast [...] The thing is that the 'Linux/Glibc@i386' prototype of ptrace() [1] is different from the "expected" one from '<sys/ptrace.h>' [2]. The patch now #ifdefine-s the ptrace(...) functions according to architecture. #ifdefine-s were roughly taken from 'defs.h' and wired into the warnings-emitting code. Anyway, I pretty wonder whether this part of the patch [...] +#endif /* !LINUX */ +#else /* !__STDC__ */ + ptrace(); +#endif /* !__STDC__ */ `-------------------------------^^^^^^^^^ [...] is of some use... (I obviously couldn't test it on current distros with glibc.) Michal -- [1] defs.h: 159 extern long ptrace(int, int, char *, long); [2] long ptrace(enum __ptrace_request request, pid_t pid, void *addr, void *data); |