From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id A42303954419 for ; Tue, 12 May 2020 12:03:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A42303954419 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-64-MH-QOqWIMX2cVY6tLK7hcQ-1; Tue, 12 May 2020 08:03:24 -0400 X-MC-Unique: MH-QOqWIMX2cVY6tLK7hcQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0ABE0102C80C; Tue, 12 May 2020 12:03:23 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-112-83.ams2.redhat.com [10.36.112.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 397111036B4B; Tue, 12 May 2020 12:03:22 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id 04CC37pg001611; Tue, 12 May 2020 14:03:07 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 04CC2tsS001610; Tue, 12 May 2020 14:02:55 +0200 Date: Tue, 12 May 2020 14:02:55 +0200 From: Jakub Jelinek To: JonY <10walls@gmail.com> Cc: gcc-help@gcc.gnu.org, Liu Hao Subject: Re: mingw-w64 and __attribute__((format(printf))) issue Message-ID: <20200512120255.GJ8462@tucnak> Reply-To: Jakub Jelinek References: <84f2a94f-0d73-fe05-78c6-bd64c1f8ee76@126.com> <50dad4c6-10cd-ed24-e563-5adc6ad50afc@gmail.com> <23b06c2e-4724-d70c-1b2a-ac7e2d94a5b4@126.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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=-10.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 12:03:29 -0000 On Tue, May 12, 2020 at 11:14:02AM +0000, JonY wrote: > >> I think option #3 is the simplest approach in the short term, though I > >> prefer option #2. > >> > > > > This patch has been accepted by MSYS2 [1], tested for bootstrapping on > > both i686 and x86_64. > > > > So here comes a 4th option: Disable `-Werror` if `--disable-werror` is > > specified to the top-level configure. > > > > EGREP'ing for `(format|__format__)\s*\(\s*(__printf__|printf)` in GCC > > source reveals ~30 matches (excluding testsuites). Probably they should > > all be fixed similarly, or we ignore such warnings for simplicity. > > libgomp doesn't build despite `--disable-werror` at top level, which > > seems a bug in this case. > > > > > > [1] > > https://github.com/msys2/MINGW-packages/blob/9501ee2afc8d01dc7d85383e4b22e91c30d93ca7/mingw-w64-gcc/0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch > > > > > > Any thoughts on the libgomp printf attribute changes? gomp_fatal etc. call vfprintf under the hood though, does that one handle %llu on mingw? If not, using %llu for the PRI* macros looks wrong to me. Jakub