From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44364 invoked by alias); 18 Jun 2017 21:32:08 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 44354 invoked by uid 89); 18 Jun 2017 21:32:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 18 Jun 2017 21:32:05 +0000 Received: by simark.ca (Postfix, from userid 33) id F3A1A1E5A2; Sun, 18 Jun 2017 17:32:07 -0400 (EDT) To: Thomas Petazzoni Subject: Re: [PATCH] nat/linux-ptrace.c: add missing gdb_byte* cast X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 18 Jun 2017 21:32:00 -0000 From: Simon Marchi Cc: gdb-patches@sourceware.org In-Reply-To: <20170618211819.29614-1-thomas.petazzoni@free-electrons.com> References: <20170618211819.29614-1-thomas.petazzoni@free-electrons.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.5 X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00489.txt.bz2 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 Thanks for the patch! I pushed it with minor changes (formatting & ChangeLog). Simon