This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: wchar_t printf() format warning
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: Eric Blake <eblake at redhat dot com>, Jonathan Roelofs <jonathan at codesourcery dot com>, "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Thu, 19 Mar 2015 11:05:53 -0500
- Subject: Re: wchar_t printf() format warning
- Authentication-results: sourceware.org; auth=none
- References: <5509EE56 dot 8090307 at oarcorp dot com> <5509F232 dot 9070501 at codesourcery dot com> <550ADFF7 dot 9060904 at oarcorp dot com> <550AEF55 dot 4010004 at codesourcery dot com> <550AF079 dot 2000708 at redhat dot com>
On 3/19/2015 10:51 AM, Eric Blake wrote:
> On 03/19/2015 09:46 AM, Jonathan Roelofs wrote:
>
>> That's a platform decision, not a gcc decision. AFAIK, there is no
>> language requirement that wint_t and wchar_t be the same type.
> In fact, on cygwin, wchar_t is 16-bit, but wint_t is 32-bit, because
> there is no free 16-bit value that can hold WEOF. On the other hand, on
> cygwin, passing wchar_t through va_arg promotes to 32-bit, so it happens
> to promote to wint_t and programmers can get away without the cast -
> whereas your platform was a question of wchar_t (32-bit int) not
> promoting to wint_t (32-bit long), making the cast necessary unless you
> can fix gcc to not use inconsistent 32-bit types.
>
Eric.. you've hacked on gcc a long time. Is this worth the trouble with gcc?
It involves a fair number of target architectures and target OSes. Seems
of questionable value. What do you think?
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985