bug-gnulib
[Top][All Lists]
Advanced

[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.13


From: Bruno Haible
Subject: Re: Solaris 8 mbrtowc failure (was: snapshot 3 in preparation for 1.4.13)
Date: Wed, 25 Feb 2009 02:01:49 +0100
User-agent: KMail/1.9.9

Gary,

> > 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

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?

- What's the value for LOCALE_ZH_CN in config.status?

- 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
  => ?

- 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
  => ?

The expected output for both is:
  0x000000DF 4

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]