This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] nat/linux-ptrace.c: add missing gdb_byte* cast
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Sun, 18 Jun 2017 22:50:03 -0400
- Subject: [binutils-gdb] nat/linux-ptrace.c: add missing gdb_byte* cast
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT ffce45d2243e5f52f411e314fc4e1a69f431a81f ***
Author: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Branch: master
Commit: ffce45d2243e5f52f411e314fc4e1a69f431a81f
nat/linux-ptrace.c: add missing gdb_byte* cast
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): Add cast to
gdb_byte*.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>