Forum > Designer

Lazarus has Synesthesia

<< < (2/2)

PascalDragon:
It's nothing in the compiler that goes wrong, it's how TColor is declared that is the problem.

In a correctly working Lazarus/FPC combination (namely before the change I mentioned and after it) TColor is essentially declared as


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type  TColor = type LongWord;
It's important that it is declared as a unique type as otherwise the type information for TColor and LongWord won't be different.

Now, if you have a wrong combination of Lazarus and FPC (in your case: Lazarus after the fix, FPC before the fix) you'll essentially have the following:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type  TColor = LongWord;
This difference essentially has no problems in normal programs except for a specific one: The IDE registers a property handler for all TColor properties. Now in the second case TypeInfo(TColor) = TypeInfo(LongInt), thus the property handler was registers for all LongInt properties! If the two types are distinct the LongInt properties aren't affected obviously ;)

dbannon:
Wow, thats subtle ! Thanks for explaining.

I'll stick with FPC 3.20 for now, at least until the next call for testing. It looks like the changes you mention are not going into fixes 3.2 and main is just a bit scary.

Thanks Again !

Davo

PascalDragon:

--- Quote from: dbannon on January 03, 2022, 02:38:54 pm ---It looks like the changes you mention are not going into fixes 3.2 and main is just a bit scary.
--- End quote ---

What do you mean? The changes for this are in both FPC main and 3.2.3 (which will become the next 3.2.4 release) as well as Lazarus main and the upcoming 2.2 release. It's just that you're using a FPC 3.2.3 that can no longer be considered up to date (3.2.3 is a moving target after all).

dbannon:
OK, my bad. I was looking at the tag "3.2.3" (no action for 7 months) but there is a separate version "fixes_3_2", that does have recent, including the TColor, commits, see attached.

So, when the talk was about "3.2.3", well, it is a touch confusing. But the one to get is obviously, Fixes_3_2 . Good !

Thanks

Davo

PascalDragon:

--- Quote from: dbannon on January 04, 2022, 11:08:55 am ---OK, my bad. I was looking at the tag "3.2.3" (no action for 7 months) but there is a separate version "fixes_3_2", that does have recent, including the TColor, commits, see attached.
--- End quote ---

That tag probably got created during the conversion from SVN to Git.


--- Quote from: dbannon on January 04, 2022, 11:08:55 am ---So, when the talk was about "3.2.3", well, it is a touch confusing. But the one to get is obviously, Fixes_3_2 . Good !

--- End quote ---

Just keep in mind that if the lowest number is odd (3.2.3, 3.3.1), it's a development version, thus it's always a moving target.

Navigation

[0] Message Index

[*] Previous page

Go to full version