[uClibc]the 'strcmp' function supports only C|POSIX locales

Manuel Novoa III mjn3 at codepoet.org
Mon Mar 3 14:22:26 UTC 2003


On Mon, Mar 03, 2003 at 03:03:57PM +0100, Sander Smeenk wrote:
> Quoting Sander Smeenk (ssmeenk+uclibc at freshdot.net):
> 
> > | update.o(.text+0x49b): In function `main':
> > | : the 'strcmp' function supports only C|POSIX locales
> 
> FUP'ing myself, maybe this is of interrest.
> 
> I creates this test-program:
> 
> | #include <stdio.h>
> | 
> | int main () {
> |         if (strcmp("aa", "bb")) {
> |                 printf("Yallah!\n");
> |         } else {
> |                 printf("Nooyah!\n");
> |         }
> |         return 0;
> | }
> 
> And during compile I get:
> 
> | /tmp/ccKutWaR.o(.text+0x1e): In function `main':
> | : the 'strcmp' function supports only C|POSIX locales

GRR... someone replaced a development #warning message I accidently left
in with a _completely_stupid_ linker warning.  The only time a locale
linker warning should be issued is if locale support is not enabled
and setlocale() is linked.

> I changed it to this, although I am not familiar with locales, this
> *should* work:
> 
> | #include <stdio.h>
> | #include <locale.h>
> | 
> | int main () {
> |         setlocale(LC_ALL, "C");
> |         if (strcmp("aa", "bb")) {
> |                 printf("Yallah!\n");
> |         } else {
> |                 printf("Nooyah!\n");
> |         }
> |         return 0;
> | }
> 
> And now it says:
> 
> | /tmp/cceyB8fy.o(.text+0x1b): In function `main':
> | : the 'setlocale' function supports only C|POSIX locales

This is just a reminder that setlocale() was linked with your
application but uClibc wasn't built with full locale support.
The linker has no way of determining what locale is being set.

> | /tmp/cceyB8fy.o(.text+0x30): In function `main':
> | : the 'strcmp' function supports only C|POSIX locales

As stated eariler, this is garbage and will be removed.  But it is
just noise.  It has no other effect.

> I even added 'locale' to the Makefile of my testprogram, so I see what
> locale it uses when invoking the compiler, all LC_* and LANG settings
> are set to "C".
> 
> I tried using 'strcasecmp'. The compile-warnings/errors go away then,
> but the resulting binaries (ebtables/iptables) still do not work.
> 
> But still it is weird that my test program /does/ work. *raah*:

That's because strcmp isn't the problem.  The implementation hasn't
changed in months and it passes the regression tests (I just rechecked).

Try running your program in the debugger, or at least inserting some
diagnostic printf()s to see what's really going on.

Manuel



More information about the uClibc mailing list