Sign in Join

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

Mailing lists / fpc-pascal / 2007-05

Release of fpc-2.1.4 aka 2.2.0-beta

11 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

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

Joost van der Sluis

Hello everybody,

I'm happy to announce that release 2.1.4 aka 2.2.0 beta is out. We ask our users to test the changes made in the last few years. This beta will be available for about two months, whereafter 2.2.0 will be released. Helping us to test version 2.1.4 now, can avoid problems when you finally update your fpc-version to 2.2.0.

Greetings

Joost
(on behalf of the whole FPC team)

Reply by email

Martin Schreiber
to Joost van der Sluis
Joost van der Sluis wrote 6 lines
I'm happy to announce that release 2.1.4 aka 2.2.0 beta is out. We ask our users to test the changes made in the last few years. This beta will be available for about two months, whereafter 2.2.0 will be released. Helping us to test version 2.1.4 now, can avoid problems when you finally update your fpc-version to 2.2.0.

I stopped testing of 2.2, it can not be used with MSEide+MSEgui because of win32 widestring problems, sorry :-(

Martin

Reply by email

bartek
to Joost van der Sluis: I'm happy to announce that release 2.1.4 aka 2.2.0 beta is out. We ask our users to test…

Hi,

I tried to compile my current project with the new compiler (2.1.4). This resulted in the following error:

-----8<-----
/home/bartek/Dev/units/vmath.pp(435,29) Error: Can't take the address of constant expressions
-----8<-----

-----8<-----
destructor TLazyVariableManager.Destroy;
var
	i: integer;
begin
	for i:=0 to LazyVariableList.count -1 do
		TLazyVector4(LazyVariableList.items[i]).Free;
	freeandnil(LazyVariableList); // <-- 435 is here
end;
-----8<-----
The definition is:
-----8<-----
	TLazyVariableManager = class
	private
		fLazyVariableList: TFPList;
	public
		constructor Create;
		destructor Destroy; override;
		procedure run;
                // properties
		property LazyVariableList: TFPList read fLazyVariableList write
fLazyVariableList;
	end;
-----8<-----
Seems like the handling of properties has changed. Replacing with
FLazyVariableList helps of course, but then again I get the same error here:
-----8<-----
/home/bartek/Dev/units/glgui/glgui.pp(376,26) Error: Can't take the address of
constant expressions
-----8<-----
constructor TGLGUI3DMouseMapper.Create(aOwnerDesktop: TGLGUIDesktop);
begin
	OwnerDesktop:=aOwnerDesktop;
	OwnerDesktop.MouseMapper:=self; // 376 is here
end;
-----8<-----
Definition snippet:
-----8<-----
                // properties
                property OwnerDesktop: TGLGUIDesktop read fOwnerDesktop write
fOwnerDesktop;
-----8<-----

What are the changes in handling properties? And how do I have to change my code to work again. Or what would be "the right thing" to do in my situation?

Thanks in advance
bartek

Reply by email

Marc Weustink
to bartek
bartek wrote 20 lines
Hi, I tried to compile my current project with the new compiler (2.1.4). This resulted in the following error: -----8<----- /home/bartek/Dev/units/vmath.pp(435,29) Error: Can't take the address of constant expressions -----8<----- -----8<----- destructor TLazyVariableManager.Destroy; var i: integer; begin for i:=0 to LazyVariableList.count -1 do TLazyVector4(LazyVariableList.items[i]).Free; freeandnil(LazyVariableList); // <-- 435 is here end; -----8<-----

The error is IMO somewhat cryptic, but you cannot pass a property as var parameter anymore. This to be inline with properties implemented by a Setter.

Marc

Reply by email

Jonas Maebe
to Marc Weustink
Marc Weustink wrote
The error is IMO somewhat cryptic, but you cannot pass a property as var parameter anymore. This to be inline with properties implemented by a Setter.

Strange, this change has not yet been merged to the fixes branch (so it's definitely not yet in 2.1.4)

Jonas

Reply by email

bartek
to Jonas Maebe
Jonas Maebe wrote 8 lines
On 20 May 2007, at 14:53, Marc Weustink wrote: > The error is IMO somewhat cryptic, but you cannot pass a property > as var parameter anymore. This to be inline with properties > implemented by a Setter. Strange, this change has not yet been merged to the fixes branch (so it's definitely not yet in 2.1.4)

This made me curious, and I checked my links. Seems like I accidentally compiled with fpc 2.3.1. I am very sorry, my bad :( . But OTOH, I still want to know what I need to do to get my code to work with 2.3.1 .

bartek

Reply by email

Jonas Maebe
to bartek
bartek wrote 6 lines
This made me curious, and I checked my links. Seems like I accidentally compiled with fpc 2.3.1. I am very sorry, my bad :( . But OTOH, I still want to know what I need to do to get my code to work with 2.3.1 .

As Marc said: do not pass properties as var-parameters (regardless of the implementation of the properties).

Jonas

Reply by email

bartek
to Jonas Maebe
Jonas Maebe wrote 11 lines
On 20 May 2007, at 16:20, bartek wrote: > This made me curious, and I checked my links. Seems like I > accidentally > compiled with fpc 2.3.1. I am very sorry, my bad :( . > But OTOH, I still want to know what I need to do to get my code to > work with > 2.3.1 . As Marc said: do not pass properties as var-parameters (regardless of the implementation of the properties).
OK. And what about this:
-----8<-----
/home/bartek/Dev/units/glgui/glgui.pp(376,33) Error: Can't take the address of
constant expressions
-----8<-----
constructor TGLGUI3DMouseMapper.Create(aOwnerDesktop: TGLGUIDesktop);
begin
        OwnerDesktop:=aOwnerDesktop;
        OwnerDesktop.MouseMapper:=self; // 376 is here
end;
-----8<-----

Definition snippet:
-----8<-----
                // properties
                property OwnerDesktop: TGLGUIDesktop read fOwnerDesktop write fOwnerDesktop;
-----8<-----

bartek

Reply by email

Jonas Maebe
to bartek
bartek wrote 20 lines
OK. And what about this: -----8<----- /home/bartek/Dev/units/glgui/glgui.pp(376,33) Error: Can't take the address of constant expressions -----8<----- constructor TGLGUI3DMouseMapper.Create(aOwnerDesktop: TGLGUIDesktop); begin OwnerDesktop:=aOwnerDesktop; OwnerDesktop.MouseMapper:=self; // 376 is here end; -----8<----- Definition snippet: -----8<----- // properties property OwnerDesktop: TGLGUIDesktop read fOwnerDesktop write fOwnerDesktop; -----8<-----

You cannot write to fields of properties. The reason is that any property accessor should be transparently replaceable by a function call, and if you do that in the above expression then your assignment would change something inside the (temporary) function result rather than in the field.

Jonas

Reply by email

Florian Klaempfl
to Martin Schreiber: I stopped testing of 2.2, it can not be used with MSEide+MSEgui because of win32…
Show quoted text 9 lines
On Sunday 20 May 2007 00.41, Joost van der Sluis wrote: > I'm happy to announce that release 2.1.4 aka 2.2.0 beta is out. We ask > our users to test the changes made in the last few years. This beta will > be available for about two months, whereafter 2.2.0 will be released. > Helping us to test version 2.1.4 now, can avoid problems when you > finally update your fpc-version to 2.2.0. > I stopped testing of 2.2, it can not be used with MSEide+MSEgui because of win32 widestring problems, sorry :-(

The problem is that the old behaviour was even buggy while the current is only unexpected.

Reply by email

bartek
to Jonas Maebe: You cannot write to fields of properties. The reason is that any property accessor should…
Jonas Maebe wrote 28 lines
On 20 May 2007, at 16:38, bartek wrote: > OK. And what about this: > -----8<----- > /home/bartek/Dev/units/glgui/glgui.pp(376,33) Error: Can't take the > address of > constant expressions > -----8<----- > constructor TGLGUI3DMouseMapper.Create(aOwnerDesktop: TGLGUIDesktop); > begin > OwnerDesktop:=aOwnerDesktop; > OwnerDesktop.MouseMapper:=self; // 376 is here > end; > -----8<----- > > Definition snippet: > -----8<----- > // properties > property OwnerDesktop: TGLGUIDesktop read > fOwnerDesktop write > fOwnerDesktop; > -----8<----- You cannot write to fields of properties. The reason is that any property accessor should be transparently replaceable by a function call, and if you do that in the above expression then your assignment would change something inside the (temporary) function result rather than in the field.

Thank you very much, now everything works like a charm.

bartek

Reply by email