I can reproduce it now on Mac OS X 10.3, it doesn't happen on Mac OS X 10.2. I guess it has something to do with the redirection used in the fjf165a.cmp script, but this is really something for shell-script experts:
if gcc dummy.c > /dev/null 2>&1 && [ -r "$A_OUT" ] && [ x"`./"$A_OUT" 2> /dev/null`" = x"ƒ" ]; then
^^ (quote mark as anti wrap move) ^
shouldn't that thing above be ", not /"? I have no idea what it is all doing.
Lets split it into blocks: 1) gcc dummy.c > /dev/null 2>&1 compiles dummy.c and redirects output (stdout,stderr) to /dev/null (bit bucket) 2) [ -r "$A_OUT" ] test if $A_OUT exists and is readable. 3) x"`./"$A_OUT" 2> /dev/null`" = x"ƒ" test if $A_OUT outputs ƒ 3.a) `./"$A_OUT" 2> /dev/null` execute $A_OUT and redirect stderr to /dev/null 3.b) compare outputs
I would suggest rewrite the conditions to a multiple lines/blocks. something like : ------------------------------------------------------- gcc dummy.c > /dev/null 2>&1 if [ ! $? ]; then echo "failed: can not compile the test C code" exit(1) fi if [ ! -r $A_OUT ]; then echo "failed: can not read the test C code" exit(1) fi ./$A_OUT 2> /dev/null 1>./$A_OUT.dat rm -f "$A_OUT" dummy.c printf "\x80" > ./${A_OUT}2.dat
if [ ! -r $A_OUT.dat ] || [ ! -r $A_OUT.dat ]; then echo "failed: can not read output of the test C code" exit(1) fi
cmp ./$A_OUT.dat ./${A_OUT}2.dat > /dev/null 2>&1 if [ $? ]; then $1 $2 else rm -f dummy.c echo "SKIPPED: German locale not installed" fi -------------------------------------------------------
comparison can be also ./$A_OUT 2> /dev/null | hexdump >./$A_OUT.dat # ... file tests as previous diff./$A_OUT.dat <<EOF 0000000 8000 0000001 EOF
Question is what exactly are we testing?
Are we testing that the compiler, shell and function toupper can work with non ASCII characters [in this case A umlaut]? printf ("%c\n", toupper ((unsigned char) '‰')); or
Are we testing the ability of toupper converting a non ASCII character ? printf ("%c\n", toupper ((unsigned char) 0x80));
The difference can be significant on some platforms.
Adriaan the non ASCII character was important for this test.
Is there any standard and portable way to obtain a selected localized letter? Example get platform representation of A-umlaut or u-circle.
The issue here is that different platforms can have different encoding of the character. Unicode vs. Latin-1, Windows etc.
Jan