How to disable per-local string functions?

Corinna Vinschen vinschen@redhat.com
Mon Mar 20 10:58:00 GMT 2017


On Mar 19 08:24, Philip Munts wrote:
> I have a resource constrained Cortex-M0 application that fails with
> newlib 2.5.0.  The strncasecmp() function is now pulling in a lot of
> locale handling code, which I presume results from commit
> c1b7d9d93dc8e88693162c0d984a114371919fdd, "Implement per-locale string
> functions".
> 
> How can I either build newlib, or build my application to use the
> original string functions instead of the new *_l locale handling
> string functions?

strncasecmp does not use strncasecmp_l.  It just calls tolower, which
calls isupper, which in turn calls a function accessing the
__global_locale struct.  I *think* the problem is that this pulls in all
of libc/locale/locale.c, so the problem could perhaps alleviated by
moving __locale_ctype_ptr() and the __global_locale struct to separate
files...?

When I implemented this functionality I asked specificially for input
from users of small targets.  I tried to keep the footprint as small as
possible, but there's very likely room for further improvement.

So, here's my request again:  If somebody has problems with the size
of the code due to the locale stuff, please provide patches.

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/20170320/f4565741/attachment.sig>


More information about the Newlib mailing list