I've been using cnPack and PascalAnalyzer Lite to clean up the uses clauses in some large projects, and I'm doing it rather conservatively. In particular I'm not removing anything that has an initialization
section. PascalAnayser gives hints such as
==> COMMAND unnecessary (used by unit with init)
I assume this is saying that this unit is not used by the current unit, but it is used by a unit that has an initialization
section.
Is this unit COMMAND
completely safe to remove or is there some situation where removing it might cause some sort of run-time error?
You can safely remove that unit.
That hint is just there out of consistency, to give you some more information - although that information is irrelevant to the decision whether that unit can be removed from the uses clause, can be moved to the implementation section or has to stay where it is.
In case you are trying to get rid of that unit, you now know that you have to check that unit with initialization: Does it actually need that unnecessary unit or can it perhaps be removed safely itself?
As you already mentioned: it is just a hint - it doesn't invalidate the unnecessary mark.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With