From patchwork Wed Jun 7 10:21:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Costas Argyris X-Patchwork-Id: 104385 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp149766vqr; Wed, 7 Jun 2023 03:22:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ79wtDXhQUUSbulzySW05xvduryZrVw4Qx2atFBY2M5FEbjWE8MkEQuuu/Jj1Vfz81RG1xe X-Received: by 2002:a17:907:7e8c:b0:96f:8b64:c0 with SMTP id qb12-20020a1709077e8c00b0096f8b6400c0mr5256983ejc.39.1686133363885; Wed, 07 Jun 2023 03:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686133363; cv=none; d=google.com; s=arc-20160816; b=0+FgQrcOrfsbDT/7ct+azOe7cP2sbIlbCldgn2h3r6thFYXEcSaYK960c2yLRNAJjF ouFBOoC2difTo9/FxLHDt2aw91cbX95C5pXpg2vng7vZyKMqw14gY9usCuq6RHO+qRiT WtU33P+YpPll1o1qg0/9GoHW8wNCEKOBn8F9Ps041Vewi/czTKWmv+QBSvVjDHAalNS0 eI2H7JDcUZRVySM8HpqCbZqjZdaW9eM82I1gzq0eEFmlhFHpb+6nBIBN13ccvfwlpkyj +XVkMYSU9xip5P4w2fbLzRRrgQ+v4An1+Khf6oe8NTAjp38Y+7kEaw5TsgKB6qfxeeTn /TmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:to:subject :message-id:date:mime-version:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=SUkg7H7tPKWLesrc/hu0RV/CvaxD3OhkCBSNAu/sEuo=; b=kDLKzw3ntIDMlGPr/RynQP4x2v8CRYS+mUa/n4uVrp9mv9YkIeO6bQgLQIa8uzyM2Q nX4BVKVWejKbZyPDOBDhfYCkhyGQpqwDMHUn7O8zjKMdMivIMwNpwa+RddcsFHoHbMyo rh89aeMgE2tv0us3RQYmv1UMEKwTCMfQ1Hh9w/1xJ3JPT6i/TmoA6qRAlUM82b+IWF52 xxLMupyaJCNQqjmTRXczkDLjX2J2PM1YF5xivQezq9TnSJdTcG8Z7z8B6YPGANN9OucH FozYkJ5pk7MkDEcHdrdr4VUvPxUMyY5+awKjD2un0Ixw0IayPuKywI860XfdZ/GyNphG EVhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=NUdcXJ6b; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id u1-20020a1709061da100b0096f441389d3si7372859ejh.659.2023.06.07.03.22.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 03:22:43 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=NUdcXJ6b; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C900C3857734 for ; Wed, 7 Jun 2023 10:22:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C900C3857734 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686133362; bh=SUkg7H7tPKWLesrc/hu0RV/CvaxD3OhkCBSNAu/sEuo=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=NUdcXJ6b5eKOD7jWlpX5SfeRlDZyUNlyaBmMVHoZOG0Z/OHwWUUCq+JqNwrdPPqih M9uLc6JpMqla6RM5nx+CVT+KrASc0Ec5UZbH95xIVKgZFzU4Idr2g3CqgsCpSxW4a6 r3nCnFy15z+jvk5o3zzkQygy/DHnsYg+m+AY/Eh0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id CBB603858C54 for ; Wed, 7 Jun 2023 10:21:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CBB603858C54 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5149c76f4dbso1208282a12.1 for ; Wed, 07 Jun 2023 03:21:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686133314; x=1688725314; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Ekci06QLyF56zHcqtEmyP89GysvyB36ZSDBfhQIsxps=; b=Z2rVXgpkjapzV8Gy749MDyFudzlZ+1FKADZoThLiLddRne/uziawjeo/GVpAhe78tr 9/hW89EyDT/kX1dk3QVmh6d+cmjCTpe06MEhl9scVClaTiULOCOfnJ5gCBGDlwGKjJ80 AYaAR6V/S/aE/jgQVD9G/hqdEsizcXmvrS7MTBhpVpFY462St9Us84icJaSi0WUkBiP8 T9CrS/0sog0e54yqw43jv5lVgR/IYJabFaEizYuVevuJmUrV0wGqCtSagGKEghThRB0Q CC8Fk+5dgI3V3tIXBPlCJ7Htwh5py5JdZz3d2sdLCq5Ip2AA5q6WPEd3Ri5C1Dg9HRzG gKiw== X-Gm-Message-State: AC+VfDzLoaEtft9KVzmrmZIJ6my7FwJmYlY99bvRHcVGNEJ7nuOHKX+I wUkjfWaW00FxHCTEusHNPjsoTmXtCXGzvJoucCIBjBAalAQ= X-Received: by 2002:a05:6402:1383:b0:510:cda9:1eb7 with SMTP id b3-20020a056402138300b00510cda91eb7mr4135941edv.21.1686133314090; Wed, 07 Jun 2023 03:21:54 -0700 (PDT) MIME-Version: 1.0 Date: Wed, 7 Jun 2023 11:21:42 +0100 Message-ID: Subject: [PATCH] libiberty: pex-unix.c: Make pex_unix_cleanup signature always match body. To: gcc-patches@gcc.gnu.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Costas Argyris via Gcc-patches From: Costas Argyris Reply-To: Costas Argyris Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768038978152357483?= X-GMAIL-MSGID: =?utf-8?q?1768038978152357483?= I saw this while working on something else: pex_unix_cleanup signature doesn't always match the body of the function in terms of ATTRIBUTE_UNUSED. If the conditional code in the body is compiled, then ATTRIBUTE_UNUSED isn't correct. This change makes it always match, thereby making it a bit cleaner IMO. Costas From 4c84afd631ad09011b237790599e1c320852f82d Mon Sep 17 00:00:00 2001 From: Costas Argyris Date: Wed, 7 Jun 2023 10:34:14 +0100 Subject: [PATCH] libiberty: pex-unix.c: Make pex_unix_cleanup signature always match body. Signed-off-by: Costas Argyris --- libiberty/pex-unix.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c index 33b5bce31c2..10f8ddd2feb 100644 --- a/libiberty/pex-unix.c +++ b/libiberty/pex-unix.c @@ -814,9 +814,9 @@ pex_unix_fdopenw (struct pex_obj *obj ATTRIBUTE_UNUSED, int fd, } static void -pex_unix_cleanup (struct pex_obj *obj ATTRIBUTE_UNUSED) -{ #if !defined (HAVE_WAIT4) && !defined (HAVE_WAITPID) +pex_unix_cleanup (struct pex_obj *obj) +{ while (obj->sysdep != NULL) { struct status_list *this; @@ -827,5 +827,9 @@ pex_unix_cleanup (struct pex_obj *obj ATTRIBUTE_UNUSED) free (this); obj->sysdep = (void *) next; } -#endif } +#else +pex_unix_cleanup (struct pex_obj *obj ATTRIBUTE_UNUSED) +{ +} +#endif -- 2.30.2