From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id UEPkI2sXUWNYsA4AWB0awg (envelope-from ) for ; Thu, 20 Oct 2022 05:39:55 -0400 Received: by simark.ca (Postfix, from userid 112) id 90F061E112; Thu, 20 Oct 2022 05:39:55 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=QmGgJZ4s; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4FD9C1E0D5 for ; Thu, 20 Oct 2022 05:39:55 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CD8EA38E70E6 for ; Thu, 20 Oct 2022 09:38:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD8EA38E70E6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666258737; bh=uvW6vPoj2shIo/FL6qELwQ6+PtRunQIt4n2aeqImKqc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=QmGgJZ4sEoDkh4cEqRSZN85mLXI8rnSJe654ToJop87OQGbonisfwxWAUJAw95i87 /NlfbxqYy4CL5rC1GtDQ/4xnGnp1XXOBvehBFnRIKTALsjpG0ujX7FeqEl/SpQ0oTe lo7rjoulEoy/7QzNadeZPXgEpoEAmEUzQESfq2Rk= Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 2529A388551B for ; Thu, 20 Oct 2022 09:37:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2529A388551B Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 76B21300089; Thu, 20 Oct 2022 09:37:27 +0000 (UTC) To: Tsukasa OI , Andrew Burgess , Mike Frysinger , Nick Clifton Subject: [PATCH 26/40] sim/ppc: Remove getrusage declarations if possible Date: Thu, 20 Oct 2022 09:32:31 +0000 Message-Id: <4f666ba3e017785495a6d9e1242c827b4f74424c.1666258361.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tsukasa OI via Gdb-patches Reply-To: Tsukasa OI Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Clang generates a warning if there is a function declaration/definition with zero arguments. Such declarations/definitions without a prototype (an argument list) are deprecated forms of indefinite arguments ("-Wdeprecated-non-prototype"). On the default configuration, it causes a build failure (unless "--disable-werror" is specified). This commit removes redundant and indefinite getrusage function declarations if the known getrusage declaration is found. --- sim/ppc/emul_netbsd.c | 2 ++ sim/ppc/emul_unix.c | 2 ++ sim/ppc/mon.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/sim/ppc/emul_netbsd.c b/sim/ppc/emul_netbsd.c index 322b584a3f1..072a5df5598 100644 --- a/sim/ppc/emul_netbsd.c +++ b/sim/ppc/emul_netbsd.c @@ -48,8 +48,10 @@ #ifdef HAVE_GETRUSAGE #include +#ifndef HAVE_DECL_GETRUSAGE int getrusage(); #endif +#endif #if HAVE_SYS_IOCTL_H #include diff --git a/sim/ppc/emul_unix.c b/sim/ppc/emul_unix.c index 57691d4befc..6d4c2dad944 100644 --- a/sim/ppc/emul_unix.c +++ b/sim/ppc/emul_unix.c @@ -95,8 +95,10 @@ #ifdef HAVE_GETRUSAGE #include +#ifndef HAVE_DECL_GETRUSAGE int getrusage(); #endif +#endif #if HAVE_DIRENT_H # include diff --git a/sim/ppc/mon.c b/sim/ppc/mon.c index 4e29ec99879..3e88829f688 100644 --- a/sim/ppc/mon.c +++ b/sim/ppc/mon.c @@ -38,8 +38,10 @@ #ifdef HAVE_SYS_RESOURCE_H #include +#ifndef HAVE_DECL_GETRUSAGE int getrusage(); #endif +#endif #include "basics.h" #include "cpu.h" -- 2.34.1