summaryrefslogtreecommitdiff
path: root/systems/unix/tex-fpc/fpcbugs
blob: 58162f5678f00695dfb804ce253e217b04d9a99e (plain)
1
2
3
4
5
6
7
8
9
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
1. for a=4095, b=4096, of subtype [0..65535] (halfword in TeX) fpc
cannot compile a+b-8192: Can't determine which overloaded function
to call

2. To fix, I changed the expression to abs(int(a+b-8192)).  But
instead of -1 it evaluates to 1.8e+19 With this bug, the first
edition of TeX-FPC was distributed. Sorry.  In preparation of the
second edition, I turned on overflow checking. And, this deteced
the error in mf. Which I fixed then.

3. The program
{$MODE ISO}
program p (output);
var f: file of char;
begin
    rewrite(f);
    f^ := 'a';
    put(f);
    reset(f);
    while not eof(f) do
    begin
	writeln(f^); get(f)
    end;
end.
prints nothing when compiled with 3.0.4 and produces a runtime error
when compiled with 3.2.0:
a
Runtime error 100 at $000000010124C479
  $000000010124C479

3.0.4 eof is true, if the file position is set at the last item of
the file.

3.2.0 eof is true, if the file position is set past the end of file,
which complies to Pascal.

4. 3.2.0 reports a run time error 100, which means disk error, when
get is called at the last item, which does not comply to Pascal.

BTW. I detected no errors of the GNU Pascal Compiler.

5. Text files will be flushed automatically.
But only, if their name occurs in the program header.

6. Files will be assigned to external files from the command line
if their name occurs in the program header.
But only for text files.

The last two half baked features let FPC compile the compiler and
interpreter of the Pascal-p5 system, which claims to be ISO-Pascal,
since pcom, pint use only text files whose names appear in the
program header.

TeX-FPC does not depend on one of the last to features, i. e.
TeX-FPC's programs flush (or close) text-files always and assign
external file names always, since it is simply easier to code.