From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668243126; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=IP0rkEO+hVnSSPnxkqjGqxdcmVcJ0LKS0VEsxg5FvaA=; b=J6kalQ/YUXdUUnINuCk+VCytGodSau/zQ9c1BQLo7hsqWx9to/Mr13EwtURZKVjhJw4bUs TI/bMwllS1KX8y5Y3EDMglCGYJyVNRoAviuAAFT4bS4yi4T4YYchsg72U98SZKTHl5TRUa aZtJlJ4CpJ5S5yRO5Wd/dz8DatFlebw= 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 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Cc: Marcel Vollweiler Subject: [committed] libgomp: Fix up build on mingw [PR107641] Message-ID: Reply-To: Jakub Jelinek 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-Type: text/plain; charset=us-ascii 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 List-Id: 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. --- 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) Jakub