This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] assume sprintf formatting of wide characters may fail (PR 86853)
- From: Jeff Law <law at redhat dot com>
- To: David Edelsohn <dje dot gcc at gmail dot com>, Martin Sebor <msebor at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 20 Aug 2018 13:07:13 -0600
- Subject: Re: [PATCH] assume sprintf formatting of wide characters may fail (PR 86853)
- References: <CAGWvnynvoHKn7-x+-vprBMxPPDBO6ru8o7X+M5JE6mXk5RkaFQ@mail.gmail.com>
On 08/20/2018 01:05 PM, David Edelsohn wrote:
> builtin-sprintf-warn-1.c, builtin-sprintf-warn-2.c, and
> builtin-sprintf-11.c now are failing on AIX. I expect that at least part
> of the reason is 32 bit AIX uses 16 bit wchar_t
>
> #ifdef __64BIT__
> typedef unsigned int wchar_t;
> #else
> typedef unsigned short wchar_t;
> #endif /* __64BIT__ */
>
> Are the new warnings making assumptions about the width of wchar_t?
>
> Do we want to skip some of these tests on AIX?Joseph, Martin and myself are discussing how to handle a 2 byte wchar_t.
Yes, there's a broken assumption in the sprintf code for that case.
jeff