[fpc-pascal] Re: pchar with more than 255 characters

Sven Barth pascaldragon at googlemail.com
Tue Nov 15 09:34:37 CET 2011


Am 13.11.2011 17:49, schrieb Graeme Geldenhuys:
> On 13/11/2011, leledumbo<leledumbo_cool at ....>  wrote:
>> I think the
>> compiler treats functions receiving array of char (or pointer to it) as
>> ShortString when none of the directives above exist.
>
> Indeed, FPC defaults to ShortString if {$H+} is not specified. That is
> probably the problem. I really don't know why this is still so (maybe
> some performance thing inside the compiler itself). I now simply
> specify $H+ in the fpc.cfg file, in case I forget to add it to the
> header of a unit.

That the compiler uses ShortString for performance reasons is not 
related to the fact that ObjFPC uses them by default. In this case the 
reason is simply backwards compatibilty (note: not Delphi compatibilty 
:P ). Though its not the compiler which is the problem here as it has an 
explicit "{$H-}" in its define include file.

Regards,
Sven




More information about the fpc-pascal mailing list