[parisc-linux] PA glibc nls bug

Carlos O'Donell carlos at systemhalted.org
Sun Apr 22 08:18:20 MDT 2007


On 4/21/07, John David Anglin <dave at hiauly1.hia.nrc.ca> wrote:
> In the following test program, the call to nl_langinfo_l returns an
> incorrect wchar_t string.  We are dropping the first two wide chars:
> 0x0000897f 0x00005143.  You can see the difference by running this
> test on x86 and parisc under gdb, or by printing pp.

Please give me a program with:
1. Expected output.
2. Actual result.

cat >> wchart.c <<EOF
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <langinfo.h>
#include <wchar.h>
int
main ()
{
  const char *ls = "zh_TW";
  locale_t loc;
  char *nl;
  int i;
  loc = newlocale (1 << LC_ALL, ls, 0);
  if (loc == NULL) return 1;
  nl = nl_langinfo_l (_NL_WD_FMT, loc);
  if (nl == NULL) return 1;
  for (i = 0; i < 16; i++)
    printf ("%02x", nl[i]);
  printf ("\n");
  return 0;
}
EOF
gcc -O0 -Wall -pedantic -g3 -D_GNU_SOURCE -o wchart wchart.c

On x86:
2500000059000000745e000025000000

On parisc:
000000250000005900005e7400000025

I don't see any difference other than byte ordering?
What are you seeing?

Cheers,
Carlos.



More information about the parisc-linux mailing list