Hi, everybody!
How could I make this preprocessor check work?
domac:~/pascal/gcc-3.2.1/gcc/p/test> time make MASK='mtm017.pas'
pascal.check-long
rm -f *.dat *.o *.s *.i *.gpi *.gpd *.gpc core a.out stderr.out *.exe testmake.tmp dummy.c dummy.pas dummy.out diff_cr*.tmp fixcr fixcr.exe
rm -f todo/a.out todo/*.exe todo/*.o todo/*.s todo/*.i todo/*.gpi todo/*.gpd todo/core
{ gpc --version | head -1; gpc --print-search-dirs | grep install | head -1; hostname || echo "unknown host"; date "+%Y-%m-%d %H:%M:%S"; } | \
sed -e 's,^,Testing ,;N;s,\n.*gcc-lib[/\], (,;s,[/\].*,),;N;s,\n,
(,;s,$,),;N;s/\n/, /'
Testing gpc 20030507, based on gcc-3.2.1 (i686-pc-linux-gnu) (domac), 2003-06-07 15:36:13
echo "gpc -g -O3 -W -Wall -Wundef -Wpointer-arith -Wno-unused "
gpc -g -O3 -W -Wall -Wundef -Wpointer-arith -Wno-unused
PC="gpc" PFLAGS="--autobuild -g -O3 -W -Wall -Wundef -Wpointer-arith
-Wno-unused " SRCDIR="." TEST_MAKE_FLAG=test-make-flag "./test_run"
mtm017.pas | tee test_log
GPC-TEST-BEGIN
==========================
TEST mtm017.pas: ./mtm017.pas:23: conditional expression: `Low' is not defined
./mtm017.pas:23: conditional expression: trailing garbage
failed
---------------------------------------------------------------------------------
function IsValidNumberBase2 (s: String; Base: Integer): Boolean;
attribute(const);
var i, dv : Integer; attribute (register);
b : Byte; attribute (register);
function DigitValue (Dig: Char): Integer; attribute (inline, const);
var d : Integer; attribute (register);
{$if Low (Char) < 0}
{$error "this won't work: negative Char used as index}
{$endif}
v : array [0..255] of Integer = (
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, -1, -1, -1, -1, -1,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 );
begin
DigitValue := v[Dig];
end;
...
Thanks,
Mirsad
--
"I have a dream!" -- Martin Luther King Jr.