[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Solaris 8 mbrtowc failure (was: snapshot 3 in preparation for 1.4.1
From: |
Gary V. Vaughan |
Subject: |
Re: Solaris 8 mbrtowc failure (was: snapshot 3 in preparation for 1.4.13) |
Date: |
Wed, 25 Feb 2009 12:23:43 +0700 |
Hi Bruno,
2009/2/25 Bruno Haible <address@hidden>:
>> > sparc-sun-solaris2.8-suncc58 m4 tests pass, gnulib fails: test-mbrtowc4.sh
>> > test-mbrtowc.c:305: assertion failedAbort - core dumped
>> > FAIL: test-mbrtowc4.sh
configured as follows:
/opt/fsw/bin/bash ./configure CC=cc CFLAGS="-mr -Qn -xstrconst -xO2 \
-xtarget=ultra2 -xarch=v8plusa" --mandir="/opt/fsw/m414/man" \
--infodir="/opt/fsw/m414/info" --program-prefix=g \
--disable-dependency-tracking --prefix=/opt/fsw/m414
(for eventual management with a GNU Stow-a-like link farm builder)
> In order to fix or work around this, I would need to know four things:
>
> - What was the configure output regarding mbrtowc? On a different version of
> Solaris 8, I get:
>
> checking whether mbrtowc handles incomplete characters... yes
> checking whether mbrtowc handles a NULL string argument... yes
> checking whether mbrtowc has a correct return value... no
> checking whether mbrtowc returns 0 when parsing a NUL character... guessing
> yes
> checking whether mbrtowc handles incomplete characters... (cached) yes
>
> What was it in your case?
checking whether mbrtowc handles incomplete characters... guessing yes
checking whether mbrtowc handles a NULL string argument... guessing yes
checking whether mbrtowc has a correct return value... guessing no
checking whether mbrtowc returns 0 when parsing a NUL character... no
checking whether mbrtowc handles incomplete characters... (cached) guessing yes
> - What's the value for LOCALE_ZH_CN in config.status?
% grep LOCALE_ZH_CN config.status
S["LOCALE_ZH_CN"]="zh_CN.GB18030"
> - What's the result of this program, run in that locale?
> ======================= foo1.c =====================
> #include <locale.h>
> #include <stddef.h>
> #include <stdio.h>
> #include <string.h>
> #include <wchar.h>
> int main ()
> {
> char input[] = "\201\060\211\070er";
> mbstate_t state;
> wchar_t wc;
> size_t ret;
> if (setlocale (LC_ALL, "") == NULL)
> return 1;
> memset (&state, '\0', sizeof (mbstate_t));
> wc = (wchar_t) 0xBADFACE;
> ret = mbrtowc (&wc, input, 6, &state);
> printf ("0x%08X %d\n", (unsigned int) wc, (int) ret);
> return 0;
> }
> ======================================================
> $ LC_ALL=$LOCALE_ZH_CN ./foo1
> => ?
% cc -I. -mr -Qn -xstrconst -xO2 -xtarget=ultra2 -xarch=v8plusa \
-o foo1 foo1.c
% LC_ALL=zh_CN.GB18030 ./foo1
0x000000F0 2
> - What's the result of this program, run in that same locale?
> ======================= foo2.c =====================
> #include <locale.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <wchar.h>
> int main ()
> {
> char input[] = "\201\060\211\070er";
> wchar_t wc;
> int ret;
> if (setlocale (LC_ALL, "") == NULL)
> return 1;
> wc = (wchar_t) 0xBADFACE;
> ret = mbtowc (&wc, input, 6);
> printf ("0x%08X %d\n", (unsigned int) wc, ret);
> return 0;
> }
> =====================================================
> $ LC_ALL=$LOCALE_ZH_CN ./foo1
> => ?
% cc -I. -mr -Qn -xstrconst -xO2 -xtarget=ultra2 -xarch=v8plusa \
-o foo2 foo2.c
% LC_ALL=zh_CN.GB18030 ./foo2
0x00005EDC 4
> The expected output for both is:
> 0x000000DF 4
Hmm. Well, I hope that makes more sense to you than it does
to me!! And thanks for looking into it :)
Cheers,
Gary
--
Email me: address@hidden (\(\
Read my blog: http://blog.azazil.net ( o.O)
And my other blog: http://www.machaxor.net (uu )o
...and my book: http://sources.redhat.com/autobook ("("_)