https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105626

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Marek Polacek
<mpola...@gcc.gnu.org>:

https://gcc.gnu.org/g:65941a910911a8d452b6a6baaccafcc7a1d85c1f

commit r12-8552-g65941a910911a8d452b6a6baaccafcc7a1d85c1f
Author: Marek Polacek <pola...@redhat.com>
Date:   Tue Jul 5 14:22:26 2022 -0400

    c-family: Prevent -Wformat warnings with u8 strings [PR105626]

    The <https://gcc.gnu.org/pipermail/gcc/2022-May/238679.html> 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)

Reply via email to