From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 33D943858D28 for ; Fri, 7 Jan 2022 20:00:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 33D943858D28 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: Ja7jQv8LvL3lVqYySBrNjhluDEhL8CnmMXtyh98DKoWgv/V+UvWJICjYcGhXdvWa3V5a1pVLKE GZMHg8b9dof1dJkUVAjEXGtoCy08IozOcaR644soGgS3fnSheySqK94MuAbmoaeVk9IGCv7H+/ PASRnlR2Htt1xXQsqYj78LZE8gNBmDwkkwi0IzJuQsoX2999+LbWjxZZz1RviBohpZfrGj8081 OPb3zweZozu8oHa8dX9nfNzrTn7kBYwAzPMO/Yy6FtW9HBHJ1uVNp+JpP+0RCfyChEPJygv302 D+deQEMu4swR+/odFjmVd8Oo X-IronPort-AV: E=Sophos;i="5.88,270,1635235200"; d="scan'208";a="70371106" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 07 Jan 2022 12:00:29 -0800 IronPort-SDR: vXAwefhpYV9XA/Rlr3R/J0oeAd/tyucvLY1I2skGenUuWoaLUNbRaSXcIXeINJiPxWMMrz05qt 9V1dTO3WKsx/8dJBQ4m61BoOnKoIfszYHLdofEmGShVvEn/zn0eJCGP4ExY0LOtaDe1VL0UhJb sXQEkkta4U/9VcKIVY2ry4vA9bU7bMrKv/mhCQAN3WlxO1UZWxHV8uvYRPcs2F4Y9SXENP0a4j 5pxEexCGrfzwdTTzWFpC0aEQP0XqA4POwHlaFiT7tERTfriM2JGC4DbQMQjpUZ/t3vwp2SYSYA ZXk= Date: Fri, 7 Jan 2022 20:00:24 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Daniil Stas CC: Subject: Re: [PATCH v4] c-format: Add -Wformat-int-precision option [PR80060] In-Reply-To: <20220107182556.73e78c40@ux550ve> Message-ID: References: <20211127221823.301408-1-daniil.stas@posteo.net> <20211221004324.609e8f17@ux550ve> <20220107182556.73e78c40@ux550ve> 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-12.mgc.mentorg.com (139.181.222.12) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3115.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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: , X-List-Received-Date: Fri, 07 Jan 2022 20:00:31 -0000 On Fri, 7 Jan 2022, Daniil Stas via Gcc-patches wrote: > > > @@ -4248,7 +4248,7 @@ check_format_types (const substring_loc > > > &fmt_loc, && (!pedantic || i < 2) > > > && char_type_flag) > > > continue; > > > - if (types->scalar_identity_flag > > > + if ((types->scalar_identity_flag || > > > !warn_format_int_precision) && (TREE_CODE (cur_type) == TREE_CODE This makes the option apply to all types, not just integer types. Thus, it means a test such as void f (void) { __builtin_printf ("%f", 0.0f64); } is not diagnosed with -Wformat -Wno-format-int-precision. Given the option name, I don't think it should affect diagnosing that test (and there should be such a test added to the testsuite to verify that it doesn't affect diagnostics for non-integer types). -- Joseph S. Myers joseph@codesourcery.com