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 A66B53858D37 for ; Thu, 20 Jan 2022 17:04:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A66B53858D37 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-345-aToWSZ-GMRKj4eW16jPBWA-1; Thu, 20 Jan 2022 12:03:57 -0500 X-MC-Unique: aToWSZ-GMRKj4eW16jPBWA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E46BB83DD20; Thu, 20 Jan 2022 17:03:55 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.40.192.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7CDFC84D36; Thu, 20 Jan 2022 17:03:55 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 20KH3rdd234685 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 20 Jan 2022 18:03:53 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 20KH3rrN234684; Thu, 20 Jan 2022 18:03:53 +0100 Date: Thu, 20 Jan 2022 18:03:52 +0100 From: Jakub Jelinek To: Martin Sebor Cc: Martin =?utf-8?B?TGnFoWth?= , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix Werror=format-diag with --disable-nls. Message-ID: <20220120170352.GS2646553@tucnak> Reply-To: Jakub Jelinek References: <9532d734-eac1-eecb-6dbe-cd0a7fc55b36@suse.cz> <20220120101728.GG2646553@tucnak> <20220120102801.GI2646553@tucnak> <496508de-7897-2250-b863-5166879310f8@gmail.com> <20220120164329.GR2646553@tucnak> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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=-5.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: , X-List-Received-Date: Thu, 20 Jan 2022 17:04:02 -0000 On Thu, Jan 20, 2022 at 09:56:59AM -0700, Martin Sebor wrote: > > With normal -Wformat I see all expected warnings in: > > char *foo (const char *) __attribute__((format_arg(1))); > > void bar (const char *, ...) __attribute__((format(printf, 1, 2))); > > -Wformat-diag is internal to GCC and needs one of the GCC-internal > attributes to enable, like __gcc_cxxdiag__, for example like this: > > __attribute__ ((format (__gcc_cxxdiag__, 1, 2))) > void bar (const char *, ...); > > With that it triggers in all the same instances as -Wformat below > (as near I can tell for a modified test case). Glad to hear that, but then I don't understand why we didn't warn on cp/error.cc before Martin L.'s change when --disable-nls wasn't used. Jakub