I have changed the whole project to ObjFPC mode and it does not help. The behavior is the same.
Almost every 2nd unit suffers from this issue btw. So you can imagine how long it took me to re-build and re-build and finish porting the project. It took hours because of this issue.
Would it make a difference if I post this isse directly to the FPC bug tracker?
Thank you
That's what you should
NOT have done. Or you should do the opposite! Mode Delphi! when converting manually.
You should ONLY convert visual parts with the
converter and any non-visual units or libraries should be mode delphi.
Usually the converter does a good job, but not on large projects.
{$ifdef fpc}{$mode delphi}{$endif}
Note that I personally would not recommend ObjFpc mode at all. It should be on the way out. But that is opinionated.
The above advice should be sufficient.