From patchwork Mon Dec 4 10:21:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 81270 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B8B64385B83B for ; Mon, 4 Dec 2023 10:21:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id BF9543858C5E for ; Mon, 4 Dec 2023 10:21:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF9543858C5E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cebitec.uni-bielefeld.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BF9543858C5E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=129.70.160.84 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701685296; cv=none; b=g9gpu0+GvL7+RoHmeJyQXG9I+DCzyD8AGMFGua1GBaIY92Py2nir2jc54DN2bFlWcA4zTpSuVjr0HYQZrTSnTpSkD469G3G0SZ9p/zDerozevgQfMz4MVHDr8d53kR0skGeZJf2vqxquduib10E2rzhbwKhcy5jH4OLcev7OMng= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701685296; c=relaxed/simple; bh=Us++HkUCXcIRV1QxVA0asZIDWIFCaiE3VXkD/lzOcpk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ncRbKRkd9wJsAYDRpbTigG8d4YNrTdX1Gf3UNtjp8DTFiuW9KPEw2dLrXajOgt+gB3WGr9kFEO/z4Z86GVJVQz+LluOozMgZxOUHabZKVcQtofLV4mcWMGTDv2BDFG19/U6VWEtpdq2jOeaAEkZYkSgRM4NWyrlba/vGuxS6Tlk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 9130ECF958; Mon, 4 Dec 2023 11:21:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= cebitec.uni-bielefeld.de; h=content-type:content-type :mime-version:user-agent:message-id:date:date:subject:subject :from:from:received:received; s=20200306; t=1701685287; bh=Us++H kUCXcIRV1QxVA0asZIDWIFCaiE3VXkD/lzOcpk=; b=SI8TqRwd3B0GNzPn3SdGZ dpwlOfmmUAclUiM/dJVG3tcahht+u9VBycFXO/20P79Z6wu67Uz1neYBoxlwzMw9 pGNi2PkYAxrC2nJ6z+7nruJZbXNE7wcSKZLxfEGP1rq5jBLhPUIcG1X4eRlgvuzP HR/INh+2RSvqTwM0J/RijGxJi1U/y8WKI6c73zedbwdQe725Su/X8AUueotyxRnp UipUo47nx3kd6icdgECshTQqhi4wt+wDawoWRTGrKPHNSrzAU6zpjRysBI71Gv8T FPyymrv6+qTdo0kyFVNh744VzNnBFk6lgMyaC4M2AiwNqEaKJxy4UjcoBnSQmE4d A== X-Virus-Scanned: amavisd-new at cebitec.uni-bielefeld.de Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id L2n5I4sQGKZw; Mon, 4 Dec 2023 11:21:27 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p4fddb508.dip0.t-ipconnect.de [79.221.181.8]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 280BACF957; Mon, 4 Dec 2023 11:21:27 +0100 (CET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Ian Lance Taylor Subject: [PATCH] libiberty: Fix pex_unix_wait return type Date: Mon, 04 Dec 2023 11:21:26 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 X-Spam-Status: No, score=-3791.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, 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-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org The recent warning patches broke Solaris bootstrap: /vol/gcc/src/hg/master/local/libiberty/pex-unix.c:326:3: error: initialization of 'pid_t (*)(struct pex_obj *, pid_t, int *, struct pex_time *, int, const char **, int *)' {aka 'long int (*)(struct pex_obj *, long int, int *, struct pex_time *, int, const char **, int *)'} from incompatible pointer type 'int (*)(struct pex_obj *, pid_t, int *, struct pex_time *, int, const char **, int *)' {aka 'int (*)(struct pex_obj *, long int, int *, struct pex_time *, int, const char **, int *)'} [-Wincompatible-pointer-types] 326 | pex_unix_wait, | ^~~~~~~~~~~~~ /vol/gcc/src/hg/master/local/libiberty/pex-unix.c:326:3: note: (near initialization for 'funcs.wait') While pex_funcs.wait expects a function returning pid_t, pex_unix_wait currently returns int. However, on Solaris pid_t is long for 32-bit, but int for 64-bit. This patches fixes this by having pex_unix_wait return pid_t as expected, and like every other variant already does. Bootstrapped without regressions on i386-pc-solaris2.11, sparc-sun-solaris2.11, x86_64-pc-linux-gnu, and x86_64-apple-darwin23.1.0. Ok for trunk? Rainer # HG changeset patch # Parent 2e3efea7d8370094e0472added4d944ecf1e0270 libiberty: Fix pex_unix_wait signature diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c --- a/libiberty/pex-unix.c +++ b/libiberty/pex-unix.c @@ -308,8 +308,8 @@ static pid_t pex_unix_exec_child (struct int, int, int, int, const char **, int *); static int pex_unix_close (struct pex_obj *, int); -static int pex_unix_wait (struct pex_obj *, pid_t, int *, struct pex_time *, - int, const char **, int *); +static pid_t pex_unix_wait (struct pex_obj *, pid_t, int *, struct pex_time *, + int, const char **, int *); static int pex_unix_pipe (struct pex_obj *, int *, int); static FILE *pex_unix_fdopenr (struct pex_obj *, int, int); static FILE *pex_unix_fdopenw (struct pex_obj *, int, int); @@ -934,7 +934,7 @@ pex_unix_exec_child (struct pex_obj *obj /* Wait for a child process to complete. */ -static int +static pid_t pex_unix_wait (struct pex_obj *obj, pid_t pid, int *status, struct pex_time *time, int done, const char **errmsg, int *err)