[fpc-pascal] more questions on storage

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Sep 26 12:55:05 CEST 2007

On 26 Sep 2007, at 11:56, Marc Santhoff wrote:

>> Longstrings were never completely implemented nor tested, so no one
>> really knows what works and what doesn't. It would be better if the
>> compiler simply gave an error for them at compile time.
> That's irritating, because "rtl.pdf" from the 2.0.4 release says on  
> page
> 19:
> 1.1.20 $H or $LONGSTRINGS : Use AnsiStrings
> If {$LONGSTRINGS ON} is specified, the keyword String (no length
> specifier) will be treated
> as AnsiString, and the compiler will treat the corresponding  
> variable as
> an ansistring, and will
> generate corresponding code.
> I read it as there is no difference between the two (in that release)
> and the compiler switches can be exchanged.

It seems there's some confusion in terminology. {$longstrings on}  
maps to {$h+}, which indeed means that string becomes an alias for  
ansistring rather than for shortstring. Separately from that there is  
also a type called "longstring" which is basically a shortstring but  
with a 4 byte length field. It's this longstring which has not been  
implemented properly.

Ansistrings (and thus {$longstrings on}) work fine.


More information about the fpc-pascal mailing list