This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] vfprintf: Add test case for user-defined types and format specifiers
On Thu, 29 Jun 2017, Florian Weimer wrote:
> On 06/29/2017 02:39 PM, Andreas Schwab wrote:
> > On Jun 29 2017, Florian Weimer <fweimer@redhat.com> wrote:
> >
> >> The need for the wint_t cast looks like a GCC bug.
> >
> > %lc wants wint_t.
>
> Sure, but why warn about this? I doubt there are any architectures
> which define wchar_t and wint_t in such a way that the variable
> arguments promotion diverges.
The different signedness can break the ABI, if you pass a negative wchar_t
(so sign-extended to 64-bit) but the called function expects wint_t
(zero-extended to 64-bit). (E.g., the powerpc64 ABI requires such
zero-extension of an unsigned argument.)
--
Joseph S. Myers
joseph@codesourcery.com