From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by sourceware.org (Postfix) with ESMTPS id CA14F38469B5 for ; Tue, 6 Dec 2022 16:44:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CA14F38469B5 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ispras.ru Received: from [10.10.3.121] (unknown [10.10.3.121]) by mail.ispras.ru (Postfix) with ESMTPS id A520640D4004; Tue, 6 Dec 2022 16:43:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru A520640D4004 Date: Tue, 6 Dec 2022 19:43:56 +0300 (MSK) From: Alexander Monakov To: Richard Biener cc: gcc@gcc.gnu.org, David Malcolm Subject: Re: Separate warning/error thresholds for -Wfoo= In-Reply-To: Message-ID: <59ec7613-5e6-23a8-c4bc-e9381edf3a59@ispras.ru> References: <1ba6f0dc-7683-5589-6f88-9f95cab48ed8@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,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: On Tue, 6 Dec 2022, Richard Biener via Gcc wrote: > Implementation-wise one could do a similar trick as we have for > global_options vs. global_options_set - add a global_options_error copy (ick!) > (and global_options_error_set!?) and have the logic that decides whether > a warning is an error pick that set. Of course it's the actual pass that looks > at flag_xyz which holds the magic number so that pass would need to be able > to see whether it needs to look at both numbers. I'm hoping to come up with a reasonably elegant way to implement this. > Btw, does '-Werror=array-bounds=2' imply that =1 kinds are diagnosed as > warning? No, =1 kinds are diagnosed as error as well. > Does it enable -Warray-bounds=2? Yes, -Werror=array-bounds=2 is simply decomposed into -Warray-bounds=2 -Werror=array-bounds= (since PR 48088 was fixed). > I think the DWIM behavior isn't all that clear and probably depends on the > actual option we want to make it work. Yeah, I guess there will be differences of opinion here, and I'm interested to reach community consensus. Let's say I'm mostly interested in supporting -Warray-bounds=2 -Werror=array-bounds=1 (errors for most certain OOB accesses, warnings otherwise). Alexander