bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stdint C99 compat checks in m4/stdint.m4 break when wchar_t is unsig


From: Eric Blake
Subject: Re: stdint C99 compat checks in m4/stdint.m4 break when wchar_t is unsigned int
Date: Thu, 27 Sep 2007 06:08:18 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Riku Voipio on 9/26/2007 3:56 PM:
> After some intensive hair pulling on why libidn breaks arm eabi port,
> turns out libidn did not like gnulib telling it that stdint.h is not
> C99 compatible... Any why not?
>   
>       int check_WCHAR:
>       WCHAR_MIN == TYPE_MINIMUM (wchar_t)
>       && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
>       ? 1 : -1;
>   /* Detect bug in mingw.  */
> 
> Which makes sense, but turns out TYPE_MAXIMUM seem uncipherable:
> 
> #define TYPE_MINIMUM(t) \
>   ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
> #define TYPE_MAXIMUM(t) \
>   ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
> 
> Neither of these macros seem to work expected if (t) is wchar_t and wchar_t 
> is defined
> as unsigned int. Which happens to be the case on arm-linux-gnueabi...

The test in gnulib is correct.  wchar_t is unsigned int on cygwin as well,
and the gnulib test works just fine there, so I suspect the bug is in your
system headers, and not in gnulib.  What are the values of WCHAR_MIN and
WCHAR_MAX?  How many bits is unsigned int on arm-linux-gnueabi?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG+50y84KuGfSFAYARAqixAKDIFo9qSjJ07kdvG7dE2OxlYmMwWQCfVDYE
ZMn9oaHu66g/tu6/BA5sXLk=
=01Js
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]