[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Fix 32-bit compilation with gcc 5.5
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH] Fix 32-bit compilation with gcc 5.5 |
Date: |
Fri, 29 Mar 2019 19:06:34 +0100 |
Le ven. 29 mars 2019 18:41, Peter Maydell <address@hidden> a
écrit :
> On Fri, 29 Mar 2019 at 17:23, Philippe Mathieu-Daudé <address@hidden>
> wrote:
> >
> > Le ven. 29 mars 2019 13:53, Andrew Randrianasulu <
> address@hidden>
> > a écrit :
> >
> > > В сообщении от Friday 29 March 2019 11:40:42 Alex Bennée написал(а):
> > > > This will break 64 bit compiles:
> > > >
> > > > ui/curses.c: In function ‘get_ucs’:
> > > > ui/curses.c:456:50: error: format ‘%lx’ expects argument of type
> ‘long
> > > unsigned int’, but argument 3 has type ‘wchar_t’ {aka ‘int’}
> > > [-Werror=format=]
> > > >
> > > > Annoyingly it seems wchar_t can be various sizes on various
> platforms.
> > > > Maybe the simplest solution would be to upcast to a known size?
> > > >
> > > > fprintf(stderr, "Could not convert %" PRIx32 " from WCHAR_T
> to
> > > UCS-2: %s\n",
> > > > (uint32_t) wch, strerror(errno));
> > >
> >
> > Can you simply use uint16_t instead? UCS-2 chars fit in 16bit.
>
> We're not printing a UCS-2 character, though, we're printing
> a wchar_t, which isn't necessarily 16 bits.
>
Oops I missed that. The uint32_t is correct then, thanks!
> thanks
> -- PMM
>
>