From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id C7E2E382C345 for ; Tue, 30 Aug 2022 22:09:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C7E2E382C345 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.93,276,1654588800"; d="scan'208";a="84963371" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 30 Aug 2022 14:09:12 -0800 IronPort-SDR: i9dYqu+MSXHPTqhnC15DB3SdYH/KutMZw0wcRjJxr2zxlCLvfuCLwHo25a2bXA/k88oeAxlrl9 yw29Jqk5/is9ZXQ2/qznIp1nq9P0EpmaH1BOz/TbStCSjEN5p+yY4zEorCGK7FL4gN9Z/lC6lp 5E+Y0Hcu34EBCCc+UvT1nSwhjJSuXzOgywcwpt5VnT3N6dlktEWjellM/0401ppDuJSY2lko3e lB5V9rEEKisAwioJZ3F8Ox1oHzIL0wpWGxQvrJuD1NDHmB0WsufTAUQYIEIFymjcz19iLyAec7 gKg= Date: Tue, 30 Aug 2022 22:09:07 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: "Jose E. Marchesi" CC: Subject: Re: [PATCH V3] Add warning options -W[no-]compare-distinct-pointer-types In-Reply-To: <87pmgl94l2.fsf@oracle.com> Message-ID: References: <87pmgl94l2.fsf@oracle.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3111.5 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sat, 27 Aug 2022, Jose E. Marchesi via Gcc-patches wrote: > + if (metadata + 1 > data) /* { dg-warning "comparison of distinct pointer types" } */ > + if (metadata + 1 > data) /* { dg-warning "comparison of distinct pointer types" } */ > + if (metadata + 1 > data) /* There shouldn't be a warning here. */ It seems the tests are only testing the '>' comparison operator. I think all six comparison operators should be tested (in particular, you're changing two pedwarns - separate code paths for ordered and equality comparisons - but the tests only appear to cover one of the two). -- Joseph S. Myers joseph@codesourcery.com