From: Simon Marchi <simon.marchi@polymtl.ca>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] nat/linux-ptrace.c: add missing gdb_byte* cast
Date: Sun, 18 Jun 2017 21:32:00 -0000 [thread overview]
Message-ID: <c712d2a155ffc6a9c7ad24118d0c75cd@polymtl.ca> (raw)
In-Reply-To: <20170618211819.29614-1-thomas.petazzoni@free-electrons.com>
On 2017-06-18 23:18, Thomas Petazzoni wrote:
> On noMMU platforms, the following code gets compiled:
>
> child_stack = xmalloc (STACK_SIZE * 4);
>
> Where child_stack is a gdb_byte*, and xmalloc() returns a void*. While
> the lack of cast is valid in C, it is not in C++, causing the
> following build failure:
>
> ../nat/linux-ptrace.c: In function 'int
> linux_fork_to_function(gdb_byte*, int (*)(void*))':
> ../nat/linux-ptrace.c:273:29: error: invalid conversion from 'void*'
> to 'gdb_byte* {aka unsigned char*}' [-fpermissive]
> child_stack = xmalloc (STACK_SIZE * 4);
>
> Therefore, this commit adds the appropriate cast.
>
> gdb/ChangeLog:
>
> * nat/linux-ptrace.c (linux_fork_to_function): fix cast to
> gdb_byte*, needed for C++ build.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thanks for the patch! I pushed it with minor changes (formatting &
ChangeLog).
Simon
prev parent reply other threads:[~2017-06-18 21:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-18 21:18 Thomas Petazzoni
2017-06-18 21:32 ` Simon Marchi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c712d2a155ffc6a9c7ad24118d0c75cd@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=thomas.petazzoni@free-electrons.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox