Order of {$H+} and OBJFPC

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Order of {$H+} and OBJFPC

Jeff Pohlmeyer
{$H+}{$MODE OBJFPC}

Results in short strings with fpc-2.0.4, and
long strings with previous compilers.

Is this a bug fix, or a new bug?


 - Jeff
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Order of {$H+} and OBJFPC

Judison
I have noticed that too..

I changed the order in about 60 files in my project... :)

It would be nice if {$mode objfpc} makes {$H+} automatic...

My $0.02...
Judison

On 10/9/06, Jeff Pohlmeyer <[hidden email]> wrote:

> {$H+}{$MODE OBJFPC}
>
> Results in short strings with fpc-2.0.4, and
> long strings with previous compilers.
>
> Is this a bug fix, or a new bug?
>
>
>  - Jeff
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>


--
Judison
[hidden email]
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Order of {$H+} and OBJFPC

Michael Van Canneyt


On Thu, 26 Oct 2006, Judison wrote:

> I have noticed that too..
>
> I changed the order in about 60 files in my project... :)
>
> 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 :(

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Order of {$H+} and OBJFPC

Vincent Snijders
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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Order of {$H+} and OBJFPC

Felipe Monteiro de Carvalho
In reply to this post by Jeff Pohlmeyer
On 10/9/06, Jeff Pohlmeyer <[hidden email]> wrote:
> Is this a bug fix, or a new bug?

Seams a bug fix to me.

--
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Order of {$H+} and OBJFPC

Peter Vreman
In reply to this post by Michael Van Canneyt
>> I have noticed that too..
>>
>> I changed the order in about 60 files in my project... :)
>>
>> 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 :(

Breaking compatibility with existing code. The same was for making objfpc
the default compiler mode.



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal