Link failure with locale routines (when _MB_CAPABLE undefined)
Corinna Vinschen
vinschen@redhat.com
Wed Aug 24 13:42:00 GMT 2016
On Aug 24 11:56, Richard Earnshaw (lists) wrote:
> My builds last night all failed with:
>
> In file included from
> /arm/scratch/rearnsha/gnusrc/gcc-cross/trunk/newlib/libc/stdlib/../locale/setlocale.h:38:0,
> from
> /arm/scratch/rearnsha/gnusrc/gcc-cross/trunk/newlib/libc/stdlib/local.h:8,
> from
> /arm/scratch/rearnsha/gnusrc/gcc-cross/trunk/newlib/libc/stdlib/efgcvt.c:140:
> /arm/scratch/rearnsha/gnusrc/newlib/newlib/libc/include/locale.h:74:1:
> error: unknown type name 'locale_t'; did you mean 'clockid_t'?
> locale_t _newlocale_r (struct _reent *, int, const char *, locale_t);
> ^~~~~~~~
> clockid_t
> /arm/scratch/rearnsha/gnusrc/newlib/newlib/libc/include/locale.h:74:60:
> error: unknown type name 'locale_t'; did you mean 'clockid_t'?
> locale_t _newlocale_r (struct _reent *, int, const char *, locale_t);
> ^~~~~~~~
> clockid_t
> /arm/scratch/rearnsha/gnusrc/newlib/newlib/libc/include/locale.h:75:38:
> error: unknown type name 'locale_t'; did you mean 'clockid_t'?
> void _freelocale_r (struct _reent *, locale_t);
> ^~~~~~~~
> clockid_t
> /arm/scratch/rearnsha/gnusrc/newlib/newlib/libc/include/locale.h:76:1:
> error: unknown type name 'locale_t'; did you mean 'clockid_t'?
> locale_t _duplocale_r (struct _reent *, locale_t);
> ^~~~~~~~
> clockid_t
> /arm/scratch/rearnsha/gnusrc/newlib/newlib/libc/include/locale.h:76:41:
> error: unknown type name 'locale_t'; did you mean 'clockid_t'?
> locale_t _duplocale_r (struct _reent *, locale_t);
> ^~~~~~~~
> clockid_t
> /arm/scratch/rearnsha/gnusrc/newlib/newlib/libc/include/locale.h:77:1:
> error: unknown type name 'locale_t'; did you mean 'clockid_t'?
> locale_t _uselocale_r (struct _reent *, locale_t);
> ^~~~~~~~
> clockid_t
> /arm/scratch/rearnsha/gnusrc/newlib/newlib/libc/include/locale.h:77:41:
> error: unknown type name 'locale_t'; did you mean 'clockid_t'?
> locale_t _uselocale_r (struct _reent *, locale_t);
> ^~~~~~~~
> clockid_t
>
> Should the header be using struct __locale_t *?
In theory I didn't want to use struct __locale_t in the headers.
I introduced this problem by removing the POSIX-1.2008 feature test
from the _XXXlocale_r functions. Hmm.
Three ways to fix this:
- Revert the patch removing the POSIX-1.2008 feature tests.
This would be wrong since the _XXXlocale_r functions are *not*
POSIX, of course.
- Remove the POSIX-1.2008 feature tests guarding the inclusion
of sys/_locale.h, providing the locale_t typedef.
- Use `struct __locale_t *' in those cases.
What would you prefer?
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20160824/8baa2176/attachment.sig>
More information about the Newlib
mailing list