[fpc-pascal]Compiler Bug--ansistrings

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Sat Apr 26 12:00:23 CEST 2003


On Fri, 25 Apr 2003, Mark Emerson wrote:

> I found the following compiler bug involving ansistrings, running FPC
> under Linux.  The program is called bug, and it references a unit called
> bug_unit.  Both appear below.
>
> The bug_unit contains a couple of "irrelevant" declarations that remain
> after I removed masses of stuff to  narrow down the bug.  More on them below.
>
> Note that procedure test in the unit is identical to procedure test1 in
> the program, except for its name.  Note also that BOTH procedures
> involve appending a null character to an ansistring.
>
> Now, as you will see, appending the null character WORKS in test1, but
> causes a runtime error (216) in the unit.
>
> If chr(0) is changed to any other char, such as chr(1), in the unit, the
> program runs successfully.
>
> Alternatively, if chr(0) is KEPT in the unit, but instead the
> "irrelevant" procedure called tab_delim_escapes_to_chars is commented
> out, then, once again, the program runs successfully.
>
> We are currently having a far more difficult problem with ansistrings,
> but I'm not in a position to report it yet, as it involves masses of code.
>
> I LOVE this compiler.  Please fix it!  :)

The bug seems to be fixed already in the latest fixbranch compiler.
I tested the program, and it runs absolutely fine, unless I'm overlooking
something.

Michael.




More information about the fpc-pascal mailing list