[fpc-pascal]Compiler Bug--ansistrings

Florian Klaempfl Florian.Klaempfl at gmx.de
Sat Apr 26 10:23:05 CEST 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!  :)
> 
In the snapshots, it should be fixed already.





More information about the fpc-pascal mailing list