Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2006-10

Order of {$H+} and OBJFPC

6 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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

Judison
to Jeff Pohlmeyer

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

Jeff Pohlmeyer wrote 13 lines
{$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 - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Judison
Michael Van Canneyt
to Judison
Judison wrote 5 lines
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.

Vincent Snijders
to Michael Van Canneyt
Michael Van Canneyt wrote 8 lines
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

Peter Vreman
to Michael Van Canneyt: It has been considered once, but I can't remember why it was not put in effect, there was…
Show quoted text 8 lines
> 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.