@Thaddy, could you clarify your point:
See Leledumbo's answer who beat me to it
.
But there are more effects that can cause trouble along the way:
It is better to protect the string changes with $push and $pop too, because currently some versions of FPC (e.g. 3.0.4) keep the string changes in
units over unit boundaries (which is a reported bug, it should adhere to the
program settings if another unit does not define a string type)
That's why things like:
interface
{$MODE OBJFPC}{$H+} // <----- OK
{$INLINE ON}{$WARN 6058 off : }
{$MODESWITCH NESTEDPROCVARS}
{$MODESWITCH ADVANCEDRECORDS}
interface
uses
SysUtils,
LGUtils,
{%H-}LGHelpers, /// < ---- this can cause a lot of trouble afterwards.....
LGAbstractContainer,
LGHashTable,
LGStrConst;
Can bring the user into trouble.
And once the bug is fixed it won't work outside a unit
You should:
- Set the string type on a per unit basis or not at all.
- At least restore the string type.
As it stands it is a shortcut that works by accident and not by language specification and documentation.