This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Link failure with locale routines (when _MB_CAPABLE undefined)


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

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]