From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E894A3858C39; Wed, 6 Jul 2022 12:53:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E894A3858C39 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105626] -Wformat should accept u8"" strings Date: Wed, 06 Jul 2022 12:53:39 +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: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2022 12:53:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105626 --- Comment #7 from CVS Commits --- The releases/gcc-12 branch has been updated by Marek Polacek : https://gcc.gnu.org/g:65941a910911a8d452b6a6baaccafcc7a1d85c1f commit r12-8552-g65941a910911a8d452b6a6baaccafcc7a1d85c1f Author: Marek Polacek Date: Tue Jul 5 14:22:26 2022 -0400 c-family: Prevent -Wformat warnings with u8 strings [PR105626] The thread seems to have concluded that -Wformat shouldn't warn about printf((const char*) u8"test %d\n", 1); saying "format string is not an array of type 'char'". This code is not an aliasing violation, and there are no I/O functions for u8 strings, so the const char * cast is OK and shouldn't be disregarded. PR c++/105626 gcc/c-family/ChangeLog: * c-format.cc (check_format_arg): Don't emit -Wformat warnings = with u8 strings. gcc/testsuite/ChangeLog: * g++.dg/warn/Wformat-char8_t-1.C: New test. (cherry picked from commit 543828e79bfa63ef26b11a2c9ea81fd7905f33aa)=