[PATCH] Update newlib so that it passes libc++'s tests

Corinna Vinschen vinschen@redhat.com
Tue Dec 17 22:49:00 GMT 2013


On Dec 17 15:53, Craig Howland wrote:
> 
> On 12/17/2013 04:42 AM, Corinna Vinschen wrote:
> >On Dec 16 16:54, JF Bastien wrote:
> >>+#ifndef WCHAR_MAX
> >>  #ifdef __WCHAR_MAX__
> >>  #define WCHAR_MAX __WCHAR_MAX__
> >>+#elif defined(__WCHAR_UNSIGNED__)
> >>+#define WCHAR_MAX 0xffffffffu
> >>+#else
> >>+#define WCHAR_MAX 0x7fffffffu
> >>  #endif
> >and this is not quite ok.  You're assuming that wchar_t is 4 bytes, but it
> >isn't on all platforms.  The fallbacks should take that into account,
> >along the lines of
> >
> >   #define WCHAR_MAX ((wchar_t)-1)
> >
> >
>      Unfortunately, this is not OK in general, as *_MAX defines are
> required to be able to be used in preprocessor expressions, and
> casts are not always allowed in them.

Then it has to be done differently.  The point is, you can't just set
WCHAR_MAX to 0xffffffffu or 0x7fffffffu because it's wrong for some
platforms.  If the compiler doesn't provide the information, there has
to be another way.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20131217/40206d6b/attachment.sig>


More information about the Newlib mailing list