[Bug c/84500] diagnostic says "array of chars" for arrays of wchar_t, char16_t and char32_t

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Sep 24 18:48:49 GMT 2021


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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
We get in GCC 10+ (r10-464-ga9c697b88395a, same revision which fixed PR 84501):

<source>:4:18: warning: initializer-string for array of 'int' is too long
    4 |   wchar_t w[3] = L"abcd";
      |                  ^~~~~~~
<source>:5:21: warning: initializer-string for array of 'short unsigned int' is
too long
    5 |   char16_t u16[3] = u"abcd";
      |                     ^~~~~~~
<source>:6:21: warning: initializer-string for array of 'unsigned int' is too
long
    6 |   char32_t u32[3] = U"abcd";
      |                     ^~~~~~~

So fixed enough?


More information about the Gcc-bugs mailing list