Is there a possibility to make Delphi compiler display a warning for each constant that is defined but not used?
I am currently using Delphi 2006 and have several units full of resourcestrings, which are used throughout the project, and since the project is quite old, most of them aren't used anymore, although they remain in the units.
Alternatively I'm looking for a way to indicate such constants.
Delphi has no features in the program that warn or indicate constants that are not used. It can do unused local variables or unused private fields, but not unused constants.
You need to look at one of the 3rd party static code analysis tools, e.g. Peganza Pascal Analyzer. However, I would not be surprised if there were no tools that reported what you want.
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