From patchwork Mon Aug 16 10:35:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1517103 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Gp9ZQ1nhgz9sRN for ; Mon, 16 Aug 2021 20:36:46 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3808F393F837 for ; Mon, 16 Aug 2021 10:36:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 8C490393F82F for ; Mon, 16 Aug 2021 10:35:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8C490393F82F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: 3W+MzaJ91Wxyada/1imelpn4gq4DSCFmbh5Q6MkFi6pE7GbU2kQyUmX94wzLuxxArv3YkSWTj+ rpPqqVYdhDATIAWH6Vm2f8f5Zggnv+m1A6mlLEMe0uVzXHL7lsuIzR+G63jN4tVtjuvkG6nkYv oB5s1EThExO812xDd393spPRLQK+telZnJskF/Y7A1p81ZOeyZ1E2RcQCpmjOKDk6dwMdx6IwL hSuaKQgozieJoMnFDUMJ8REV0pKgqR41pUTFi+S/Dxh3PcBSAjnKkis/F63vsz9ae9mYnfZOYc 6ypeoa1ksZSXQnnmG+aZPmYE X-IronPort-AV: E=Sophos;i="5.84,324,1620720000"; d="scan'208,223";a="64733325" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 16 Aug 2021 02:35:24 -0800 IronPort-SDR: EdKOdGRB1oRhJNdFddYHUCBBpLqSp+n23hOlb9Q54FTeJFwjankv5DqvN18UcTbACFzKlB5r3I XeYWbewnVSRDBEzJGOrsZ2FoFw8tgeIGMrcrr8YZH/fgeZDdIA3K/PyACz91T8NQMychGIPlle 0pebBA15g5Q30xFTcHp8fYz6+jUVPaSigLhn88AltUKyw9sgpee3wvRLZH3z3oy01CupcpyV4n MeRHGVxhp/NH6SGkb7pacfH42RFfLYOIFcyta3hOA38f0KBNCRYnjAp8YruuoUHljNnwal+Zsc INU= From: Thomas Schwinge To: Subject: Address '?:' issues in 'libgomp.oacc-c-c++-common/mode-transitions.c' User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Mon, 16 Aug 2021 12:35:18 +0200 Message-ID: <87pmud7k49.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-06.mgc.mentorg.com (139.181.222.6) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi! Pushed "Address '?:' issues in 'libgomp.oacc-c-c++-common/mode-transitions.c'" to master branch in commit a2ab2f0dfba0fa69ebf6c82e34750911b2e5a639, see attached. Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From a2ab2f0dfba0fa69ebf6c82e34750911b2e5a639 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 11 Aug 2021 11:59:19 +0200 Subject: [PATCH] Address '?:' issues in 'libgomp.oacc-c-c++-common/mode-transitions.c' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [...]/libgomp.oacc-c-c++-common/mode-transitions.c: In function ‘t3’: [...]/libgomp.oacc-c-c++-common/mode-transitions.c:127:43: warning: ‘?:’ using integer constants in boolean context, the expression will always evaluate to ‘true’ [-Wint-in-bool-context] 127 | assert (arr[i] == ((i % 64) < 32) ? 1 : -1); | ^ [...]/libgomp.oacc-c-c++-common/mode-transitions.c: In function ‘t9’: [...]/libgomp.oacc-c-c++-common/mode-transitions.c:359:46: warning: ‘?:’ using integer constants in boolean context, the expression will always evaluate to ‘true’ [-Wint-in-bool-context] 359 | assert (arr[i] == ((i % 3) == 0) ? 1 : 2); | ^ ..., and PR101862 "[C, C++] Potential '?:' diagnostic for always-true expressions in boolean context". libgomp/ * testsuite/libgomp.oacc-c-c++-common/mode-transitions.c: Address '?:' issues. --- .../testsuite/libgomp.oacc-c-c++-common/mode-transitions.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/mode-transitions.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/mode-transitions.c index 6c989abedf5..94dc9d05293 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/mode-transitions.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/mode-transitions.c @@ -124,7 +124,7 @@ void t3() assert (n[i] == 2); for (i = 0; i < 1024; i++) - assert (arr[i] == ((i % 64) < 32) ? 1 : -1); + assert (arr[i] == (((i % 64) < 32) ? 1 : -1)); } @@ -356,7 +356,7 @@ void t9() } for (i = 0; i < 1024; i++) - assert (arr[i] == ((i % 3) == 0) ? 1 : 2); + assert (arr[i] == ((i % 3) == 0 ? 1 : 2)); } } @@ -960,7 +960,7 @@ void t23() } for (i = 0; i < 32; i++) - assert (arr[i] == ((i % 2) != 0) ? i + 1 : i + 2); + assert (arr[i] == (((i % 2) != 0) ? i + 1 : i + 2)); } -- 2.30.2