From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DD08C384AB64; Fri, 19 Apr 2024 07:04:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD08C384AB64 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713510271; bh=GTaPSK/do949FgbXnLBhpAAMN/nih/rE6OJj3wBleys=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QZnUjtfXVp/f+49NlClib9ZflEcUbWO34PGzSJJjP8Nl+QDtTqnWYpgdD1R/emWub QagRB2G0Zfu3QNw29FQvVuZA/q6SHm8JBsXfR2voi+dm1AKdLCqDp/QHgiidOsRI+k c0eJmFpPMngC1XK0cTePkEkikk8yUn+k6YHP2oOI= From: "martin at martin dot st" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/95130] GCC ignoring attribute(format(gnu_printf)) on printf in mingw Date: Fri, 19 Apr 2024 07:04:30 +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: martin at martin dot st 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 #25 from Martin Storsj=C3=B6 --- (In reply to Andrew Pinski from comment #23) > Note since MSVC 2015 runtime, printf has support %ll so ms_printf should = be > fixed to incldue that. >=20 > https://learn.microsoft.com/en-us/cpp/c-runtime-library/format-specificat= ion- > syntax-printf-and-wprintf-functions?view=3Dmsvc-140 >=20 > I think for GCC 15, we should just update ms_printf to the 2015 version of > what is supported ... As long as GCC links against msvcrt.dll, distributed with the OS, the time since it's supported in MSVC doesn't affect things much though. But as Liu Hao noted, we already do support %lld in ms_printf since c51f1e7427e6a5ae2a6d82b5a790df77a3adc99a, since it apparently was supported= in the OS provided msvcrt.dll since a number of versions anyway. (In reply to LIU Hao from comment #24) > `%L` (for floating-point specifiers) is not compatible between `ms_printf` > and `gnu_printf`. We do use gnu_printf for the UCRT printf functions (which is what MSVC ships since 2015) though, see e.g. https://github.com/mingw-w64/mingw-w64/commit/8565cdb729b96f1122b1e9c490a7b= aba7b788f18. But since the change in c51f1e7427e6a5ae2a6d82b5a790df77a3adc99a (released = in GCC 12 already), we probably don't need this any longer. So I think it migh= t be more correct to revert to ms_printf for UCRT, at least for GCC >=3D 12 - wh= at do you think?=