From patchwork Mon Nov 25 05:26:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 36181 Received: (qmail 61280 invoked by alias); 25 Nov 2019 05:33:34 -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 61180 invoked by uid 89); 25 Nov 2019 05:33:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=obtained X-HELO: mail.efficios.com Received: from mail.efficios.com (HELO mail.efficios.com) (167.114.142.138) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 25 Nov 2019 05:33:32 +0000 Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 5FC91347578 for ; Mon, 25 Nov 2019 00:27:21 -0500 (EST) Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id G-c6Txhj3Qlh; Mon, 25 Nov 2019 00:27:21 -0500 (EST) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 0456834752C; Mon, 25 Nov 2019 00:27:18 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 0456834752C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1574659638; bh=7O+1054gKSFLwAnrIjdCk1FrpoR+zKMb+C2vZUSpfcU=; h=From:To:Date:Message-Id:MIME-Version; b=g6nQoQ22wSWDY+8CNrb+s+Hsl94MzcxQwBn3WorZqhaLFzzp74qLFvDKJlmvRroTA cfUxUQuSOV0cBs2YYhMLyIniF9Lnvx2CdA9aqvERwFeviS5M34as4cbHAIVpkqm4rU Xe0NJga7x/jKkGgV1u/u67jmq/vHnjj6gDieq7WqLiqKo+VyEeNv2h3Dh9Sbepvut+ 0UMQE3pWTjXTvXQeAhqNVuoH0AJp2+zl3MbUEMjXS+PhYG0VEpw5aWSdc9QXaBj4iN 4XBxRhX3edpufGA1hS4Wc2kOFnLJruxa9VEhJhW4C5yai/8jU1WzCkXIAyQBYcYuPC lSPb1XrpRRylQ== Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id IYm75bEWMFH5; Mon, 25 Nov 2019 00:27:17 -0500 (EST) Received: from smarchi-efficios.lan (unknown [192.222.164.54]) by mail.efficios.com (Postfix) with ESMTPSA id 1D8703474BD; Mon, 25 Nov 2019 00:27:12 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 14/15] Fix declaration of sparc_xfer_wcookie Date: Mon, 25 Nov 2019 00:26:54 -0500 Message-Id: <20191125052655.22696-15-simon.marchi@efficios.com> In-Reply-To: <20191125052655.22696-1-simon.marchi@efficios.com> References: <20191125052655.22696-1-simon.marchi@efficios.com> MIME-Version: 1.0 When building sparc-nat.c with -Wmissing-declarations, we get: CXX sparc-nat.o /home/smarchi/src/binutils-gdb/gdb/sparc-nat.c: In function ‘target_xfer_status sparc_xfer_wcookie(target_ops*, target_object, const char*, gdb_byte*, const gdb_byte*, ULONGEST, ULONGEST, ULONGEST*)’: /home/smarchi/src/binutils-gdb/gdb/sparc-nat.c:255:1: error: no previous declaration for ‘target_xfer_status sparc_xfer_wcookie(target_ops*, target_object, const char*, gdb_byte*, const gdb_byte*, ULONGEST, ULONGEST, ULONGEST*)’ [-Werror=missing-declarations] sparc_xfer_wcookie (struct target_ops *ops, enum target_object object, ^~~~~~~~~~~~~~~~~~ Indeed, the declaration is not in sync with the definition, fix that. sparc_xfer_wcookie is used in sparc_target::xfer_partial. sparc_target is only used in the BSD sparc native files. The error above was obtained by running "make sparc-nat.o" on Linux with a cross-compiler for sparc64-linux-gnu. But I presume that if we were to build for real with a BSD/sparc compiler, we would end up with an undefined symbol. gdb/ChangeLog: * sparc-nat.c (sparc_xfer_wcookie): Sync declaration with definition. Change-Id: Id41e706e5516968ff6a49469ddc48eceb29dd3ea --- gdb/sparc-nat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c index 8dbf2f51ba44..3de4c1ba3ba4 100644 --- a/gdb/sparc-nat.c +++ b/gdb/sparc-nat.c @@ -252,7 +252,7 @@ sparc_store_inferior_registers (struct regcache *regcache, int regnum) TARGET_OBJECT_WCOOKIE. Fetch StackGhost Per-Process XOR cookie. */ enum target_xfer_status -sparc_xfer_wcookie (struct target_ops *ops, enum target_object object, +sparc_xfer_wcookie (enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)