This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Change function signature passed to clone
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Tue, 12 Jan 2016 13:05:22 +0000
- Subject: Re: [PATCH] Change function signature passed to clone
- Authentication-results: sourceware.org; auth=none
- References: <1452264350-25126-1-git-send-email-yao dot qi at linaro dot org>
On 01/08/2016 02:45 PM, Yao Qi wrote:
> I see the following compile error with an old bfin-uclinux gcc to
> build GDBserver,
>
> cc1: warnings being treated as errors
> gdb/gdbserver/../nat/linux-ptrace.c: In function 'linux_fork_to_function':
> gdb/gdbserver/../nat/linux-ptrace.c:283: error: passing argument 1 of 'clone' from incompatible pointer type
>
> in glibc, clone's prototype is like this, and in uClibc, it is the same,
>
> int clone(int (*fn)(void *), void *child_stack,
> int flags, void *arg, ...
> /* pid_t *ptid, struct user_desc *tls, pid_t *ctid */ );
>
> so this patch changes function signature from 'void (*function) (gdb_byte *)'
> to 'int (*function) (void *)'.
>
> Note that I find Pedro advised to change argument type from 'void *'
> to 'gdb_byte *' during the patch review
> https://sourceware.org/ml/gdb-patches/2013-08/msg00611.html however,
> I think fix compile error can justify the change back to 'void *'.
Agreed, LGTM.
Thanks,
Pedro Alves