[fpc-pascal] Order of {$H+} and OBJFPC

Vincent Snijders vsnijders at quicknet.nl
Thu Oct 26 21:34:18 CEST 2006


Michael Van Canneyt schreef:
> 
> On Thu, 26 Oct 2006, Judison wrote:
> 
>> It would be nice if {$mode objfpc} makes {$H+} automatic...
> 
> It has been considered once, but I can't remember why it was
> not put in effect, there was some reason, but I don't recall why :(
> 

Maybe because existing code assume strings in objfpc are shortstrings.

If this were to change, that code might break.

program test;
{$mode objfpc}
var
   s: string;
begin
   s:='test';
   writeln(length(s)); // resilient to string type change
   writeln(ord(s[0])); // this breaks, I think.
end.

Vincent



More information about the fpc-pascal mailing list