Previous mail
Next mail
Unformatted/full headers
Overview 10 days
Subject
Date
Thread
Author
From: jan.ruzicka@comcast.net
Subject: compiling-update
Date: 26 Jan 2005, 00:20:43
>>>
>>> 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
Previous mail
Next mail
Unformatted/full headers
Overview 10 days
Subject
Date
Thread
Author
| Author | Subject | Date |
|---|---|---|
| Adriaan van Os | compiling-update | 23 Jan 2005, 23:12:49 |
| Frank Heckenbach | compiling-update | 25 Jan 2005, 17:56:06 |
| CBFalconer | compiling-update | 25 Jan 2005, 20:00:00 |
Note: This page contains information that does not originate from the owner of this web site, but from the authors of the mails archived. The owner of this web site is not responsible for the content of such information. Any use of that infomation requires the consent of the respective author.
Where WWW addresses (URLs) in the mails archived are marked as hyperlinks, this is only for the comfort of the reader. The content of the web pages linked to like this does not necessarily reflect the opinion of the owner of this web site or of the authors of the mails archived. The owner of this web site is not responsible for the content of such web pages. Those pages are explicitly not to be considered as part of the content of this page, but merely as references.
This page was created by Crystal 0.999 (Linux 2.4.27/i686).