setlocale bug?

Nikola Vladov <[email protected]>
Newsgroups gmane.linux.lib.dietlibc
Message-ID <[email protected]>
Seems than dietlibc setlocale should work fine.
There is a line:
if (strstr(locale,".UTF-8") || strstr(locale,".UTF8")) lc_ctype=CT_UTF8;

If (locale==NULL) it must work also good!  See the code of strstr.c
The compiler makes a mistake with -Os and the function
setlocale works bad!

In my previous suggestion I changed setlocale to avoid problems
with flags -Os.  Here is one argument more:

vladov@picard:4 ~/fefe/dietlibc$ size bin-i386/setlocale.o 
   text    data     bss     dec     hex filename
    171       0       0     171      ab bin-i386/setlocale.o  (my code)

vladov@picard:4 ~/fefe/dietlibc$ size /opt/diet/lib-i386/libc.a | grep setlocale
    175       0       0     175      af setlocale.o (ex /opt/diet/lib-i386/libc.a)   (original dietlibc)


Resume:  The suggested function setlocale
works good also with (locale==NULL) and flag -Os
and is with 4 bytes shorter!

Nikola
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.