From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6AC163858414; Sat, 19 Aug 2023 19:11:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6AC163858414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692472262; bh=kcWvh1YSBo+1x2vAgJIoRmUEqyI9ggfTG7Lpz9IrQUM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fDkRKDYQUVt6EaaKd+IUm0FxMEaIjLQjqyEvOcvkcMpPyiaAG2HjCBKqe9XtQDa5f SrNdZ7Jp7kaRnZLCSg+HutXWhOrfNjFHADfhaPiCVv01yUhad6OLmnSpkAnSJyMdCa 4MWy5XLIIMz42AM/aR08IUGLmhXRUwDkFtgEZXXM= From: "tomas.kalibera at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/95130] GCC ignoring attribute(format(gnu_printf)) on printf in mingw Date: Sat, 19 Aug 2023 19:11:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 9.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tomas.kalibera at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95130 --- Comment #20 from Tomas Kalibera --- (In reply to Julian Waters from comment #19) > (In reply to Tomas Kalibera from comment #17) > > (In reply to Tomas Kalibera from comment #16) > > > (In reply to Julian Waters from comment #15) > > > > It seems like the patch also doesn't fix the strftime case too, str= angely > > > > enough. gcc with that patch applied still causes a compilation fail= ure in > > > > the Windows JDK when encountering strftime with the %T specifier > > >=20 > > > > > > I don't easily see why the patch doesn't help with %T in strftime. In > > > MinGW-W64 10, strftime doesn't seem to have a format attribute at all= , so > > > the patch couldn't help. But in MinGW-W64 11, the gnu_strftime format > > > attribute is present. > >=20 > > The older version of the patch I use with gcc 12 doesn't seem to be hel= ping > > with %T, but the newer one (patch_master.diff) helps with %T on the cur= rent > > gcc master (gcc 14) and the current gcc 13 branch (gcc 13.2). Tested wi= th > > MinGW-W64 11.0.1. >=20 > If I may ask, could I have the link to patch_master.diff? It is one of the attachments of this report, https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53778 This patch has not been reviewed. I am not an expert on GCC internals and I cannot guarantee that adding meta-data this way to the AST is safe. So plea= se use with care.=