From patchwork Sat Nov 12 08:51:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 19131 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1179990wru; Sat, 12 Nov 2022 00:52:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Vu4qhEZdGQ7oEp8nkoW0oK4CvfmTnLcEwoBoYop6TdHz6yrxSvvcstIo3L26bgtOrverh X-Received: by 2002:a17:907:985a:b0:7ae:83:5be7 with SMTP id jj26-20020a170907985a00b007ae00835be7mr4379708ejc.139.1668243174662; Sat, 12 Nov 2022 00:52:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668243174; cv=none; d=google.com; s=arc-20160816; b=ikT4QJirmqsSrJme520rwsQhipOX2YFoXOtRwnapZ0nUv186oqhknCHOTY2eH0M5f6 +6uxAusRrmXSlehIuMT970LpU030kvE2smiPaje3loh2OIvTOkTKmvoGXPsSZT+gLdSR +l2W1NnNbq6Ybt55Tnbfh0HlNm0FyRK2DPXrjyOhZQjkw4Co8+kq85KwxLH3AoB8NaWF GJWiyb64fOfeaLSBah5nJD2GZmTv7aOyNYELlls9L9DiuDmErEVHfr3m4ptAUKvw1Pxe z7Lw3HvC2yKNDbehSP3E6vS+q5TKaufd5PB2wISsh9V9eGXuGkNjon+NB4F0SJ60LUl7 wX2A== 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 :content-disposition:mime-version:message-id:subject:cc:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=IP0rkEO+hVnSSPnxkqjGqxdcmVcJ0LKS0VEsxg5FvaA=; b=oSSVYJYjkd2G2tMwJMSPAhBX0dQ6mIbjE7LSOvzY2IgK+ZhSnxEQLZlLP5Z2pPGBQt WB9C279i2wjf4bTg3chjbePtIua7dL9BP0oB+7p5OIAQh7o3Ioo5GNRXO8LVehQgAjwX s6ayOF08QvpljjlgMoS9tGrLBq8/RskJ0ADk5947ARrRdm7B2Cov6jRy2Wf2ltRZsbbX hF1krJIXTR1O073T26PYStsghQamx+VuH9sXlV9/aY4n7x88iHYXM24e7AHpgiz8TLj0 qjjB9IHTyt7f5/IT99lb8+6QEcbtn2UI2bKRn/di0PW8OfSEWVjKp9R1GOF41vcUE50L ReqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=OphTwIFW; 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 js6-20020a17090797c600b0073dda1430b9si4448140ejc.403.2022.11.12.00.52.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 00:52:54 -0800 (PST) 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=OphTwIFW; 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 A02173857352 for ; Sat, 12 Nov 2022 08:52:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A02173857352 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668243173; bh=IP0rkEO+hVnSSPnxkqjGqxdcmVcJ0LKS0VEsxg5FvaA=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=OphTwIFWJrKog0ztDbOSRGkTxnzeYU9RJTCJtBSv5WoROHN/fQJDwSmtiUdAFpXMC 4hAuIX2waVEgCchWeMG3Fg5hMErYF3r9TpqPS+RtvNO7UlZMK7IpjmJdqqZ+FELHDp lyspSdP9VsqUfGSxLW3mth7quZbDNf1GPeDhhtPs= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 56A4F385828E for ; Sat, 12 Nov 2022 08:52:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 56A4F385828E Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-575-XuL0kQYmONa9PoxBns-8zQ-1; Sat, 12 Nov 2022 03:52:02 -0500 X-MC-Unique: XuL0kQYmONa9PoxBns-8zQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 885C0101A52A; Sat, 12 Nov 2022 08:52:02 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 383C7200B42E; Sat, 12 Nov 2022 08:52:02 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 2AC8pv4A946094 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 12 Nov 2022 09:51:58 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2AC8puY9946093; Sat, 12 Nov 2022 09:51:56 +0100 Date: Sat, 12 Nov 2022 09:51:56 +0100 To: gcc-patches@gcc.gnu.org Cc: Marcel Vollweiler Subject: [committed] libgomp: Fix up build on mingw [PR107641] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek 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?1749279755241077396?= X-GMAIL-MSGID: =?utf-8?q?1749279755241077396?= Hi! Pointers should be first casted to intptr_t/uintptr_t before casting them to another integral type to avoid warnings. Furthermore, the function has code like else if (upper <= UINT_MAX) something; else something_else; so it seems using unsigned type for upper where upper <= UINT_MAX is always true is not intended. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk. 2022-11-12 Jakub Jelinek PR libgomp/107641 * env.c (parse_unsigned_long): Cast params[2] to uintptr_t rather than unsigned long. Change type of upper from unsigned to unsigned long. Jakub --- libgomp/env.c.jj 2022-09-13 18:59:52.331054977 +0200 +++ libgomp/env.c 2022-11-11 18:10:21.552415182 +0100 @@ -283,7 +283,7 @@ parse_unsigned_long_1 (const char *env, static bool parse_unsigned_long (const char *env, const char *val, void *const params[]) { - unsigned upper = (unsigned long) params[2]; + unsigned long upper = (uintptr_t) params[2]; unsigned long pvalue = 0; bool ret = parse_unsigned_long_1 (env, val, &pvalue, (bool) params[1]); if (!ret)