From patchwork Sat Oct 24 22:39:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 9354 Received: (qmail 53629 invoked by alias); 24 Oct 2015 22:39:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 53491 invoked by uid 89); 24 Oct 2015 22:39:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: smtp.electronicbox.net Received: from smtp.electronicbox.net (HELO smtp.electronicbox.net) (96.127.255.83) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 24 Oct 2015 22:39:19 +0000 Received: from simark.lan. (cable-192.222.137.139.electronicbox.net [192.222.137.139]) by smtp.electronicbox.net (Postfix) with ESMTP id A112D440E7A; Sat, 24 Oct 2015 18:39:17 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH obv/c++ 2/4] sparc64-tdep.c: Don't assign using memcpy return Date: Sat, 24 Oct 2015 18:39:14 -0400 Message-Id: <1445726356-12506-3-git-send-email-simon.marchi@polymtl.ca> In-Reply-To: <1445726356-12506-1-git-send-email-simon.marchi@polymtl.ca> References: <1445726356-12506-1-git-send-email-simon.marchi@polymtl.ca> This: valbuf = memcpy (buf, valbuf, len); causes a build failure in C++, because memcpy returns the value of "buf" as a void *. Instead of adding a cast, we can just do the assignment separately. gdb/ChangeLog: * sparc64-tdep.c (sparc64_store_arguments): Split assignment of valbuf. --- gdb/ChangeLog | 5 +++++ gdb/sparc64-tdep.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0a8a693..e86cbad 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2015-10-24 Simon Marchi + * sparc64-tdep.c (sparc64_store_arguments): Split assignment of + valbuf. + +2015-10-24 Simon Marchi + * ia64-tdep.c (ia64_pseudo_register_write): Remove cast. (ia64_push_dummy_call): Remove cast and change type of "to" to array of gdb_byte. diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c index 4c05277..a23740e 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -890,7 +890,8 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, /* Structure, Union or long double Complex arguments. */ gdb_assert (len <= 16); memset (buf, 0, sizeof (buf)); - valbuf = memcpy (buf, valbuf, len); + memcpy (buf, valbuf, len); + valbuf = buf; if (element % 2 && sparc64_16_byte_align_p (type)) element++;