Sign in Join

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

Mailing lists / fpc-other / 2010-11

Re: Interface scope incompatibility with Delphi

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Jonas Maebe
Marc Weustink wrote
If your code requires a specific unload order, code it that way by setting the variables to nil in the order you need. That is the only way you can make sure that interfaces will be unloaded in the correct order.

Even then you cannot do that, as has been mentioned multiple times in this thread: there may still be temporary "copies" of these interfaces around that were created by the compiler. I think the decision made by the company

Graeme Geldenhuys wrote 6 lines
If I fix the problem on my side, it doesn't help anybody else, because their compiler doesn't contain that fix (and as this thread shows, not everything will be accepted into the FPC source - no matter who is commissioned to implement the patch).

I didn't mean to say such a patch would not be accepted, more that I'm not willing to write it (regardless how much I'd be paid), and that even if it were changed in the compiler that it could easily become Delphi-incompatible again in the future (because of newly added optimisations to FPC, or because of temporarily disabled optimisations in case of a rewrite/refactoring), or in some scenario not tested by the submitter (since there are no specifications).

I think that if you write code that depends on compiler-specific code generation details, that the best solution is to keep using that specific compiler (or even compiler version, if you care about predictable stability).

Jonas

Reply by email