On 22 Jul 2004 at 0:56, Waldek Hebisch wrote:
Prof. Abimbola A. Olowofoyeku wrote:
Finally
Waldek's patch seems to be capable of finding more duplicate declarations than before. For example, it has found that "Maxlongint" was declared both in the system and gpc units, with the result that a program that compiled before (i.e., without update27h.diff applied) does not compile anymore ...
This is known problem -- ISO import forbids redeclaration (you may import multiple declarations, but they must have the same meaning). In standard units (`dos.pas' ...) we do:
import GPC (MaxLongInt => Orig_GPC_Maxlongint); System;
the rename prevents the conflict.
Note that `uses' is BP compatible, so you have no conflict if you write:
uses GPC, System;
Theoretically, we could make the problem transparent for users of `GPC' and `System' units. One way is to remove `MaxLongInt' form `GPC' module and make it a builtion (builtins may be redeclared). Another way is to add special attribute to symbols, so that symbols with such attribute can be redeclared. However, I followed Frank opinion that such conflicts are rare, so adding renames should be enough.
Note, that if conflict appears in user modules, the user have to modify the sources to resolve the conflict anyway. We could add some extra magic to the compiler to make it easier, but the lack of checking in previous GPC versions was a bug...
Fair enough. This means that I have to convert one of my big units (Sysutils) from a module to a unit.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/