[fpc-devel] Patches
Sven Barth
pascaldragon at googlemail.com
Fri Oct 1 09:35:38 CEST 2010
Am 01.10.2010 09:49, schrieb Hans-Peter Diettrich:
> Michael Van Canneyt schrieb:
>
>> He meant variables that are not part of an object, but declared as a unit
>> variable. If you put all such 'global' variables in 1 unit, you do
>> drag in all the original units, if the variables are typed.
>
> Every external tool has to drag in all the units, that initialize the
> used global variables, regardless of their placement in globals.pas or
> other units. Consequently all global variables should reside in those
> units, that contain their initialization code. Doing so may increase the
> number of units, that have to be used in *all* other units, be internal
> or external, but it would provide the supposed consistency of the unit
> dependencies - automagically, with no need for further considerations or
> discussions.
>
> When ppudump has to use globals.pas, this is a general misdesign. I
> wonder why e.g. pendingstate resides there, when used exclusively by the
> scanner, or init_settings and current_settings, which are meaningful
> only to the compiler and have to be initialized by code somewhere else.
> That's not a problem inside the compiler, which uses all related units,
> but then all global variables for external use should reside in an
> different unit, not in the compiler specific globals unit.
Then what about moving those variables to the units where they belong?
That might be a starting point of which the solution might be easier
applied to trunk (not only in the sense of merging, but also in the
sense of "discussion with core developers about usage"). ^^
Regards,
Sven
More information about the fpc-devel
mailing list