String in const array of string does not compile
Original Reporter info from Mantis: Terryc
-
Reporter name: Thierry Coq
Original Reporter info from Mantis: Terryc
- Reporter name: Thierry Coq
Description:
The following piece of code results in a compiler abort with the following message: Fatal: Compilation aborted.
const
aStrArray: array [0..0] of String = (
#$ffff' '
);
The same string in a const, without the array, compiles:
const
aStrArray: #$ffff' ';
If the $ffff is the last part of the string, it compiles?
Steps to reproduce:
Take the piece of code above and put it in a simple program. Compile. The compilation will abort.
A Lazarus project reproducing the problem is attached.
Additional information:
This was also tested as a bug on 2.3.1.
However in Linux, I was unable to reproduce the bug (FPC 2.4.0, Build 22279, 25-10-2009).
A work-around for me that worked was to declare a (long) list of string constants, each with a different name.
Mantis conversion info:
- Mantis ID: 16219
- OS: Windows
- OS Build: XP
- Build: 24077
- Platform: i386
- Version: 2.4.1
- Fixed in version: 2.6.0
- Fixed in revision: 15240 (#cddb2ffc)