Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi 2006 possibility to display warnings for unused constants

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.

like image 547
ertx Avatar asked Nov 27 '25 10:11

ertx


1 Answers

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.

like image 85
David Heffernan Avatar answered Dec 02 '25 05:12

David Heffernan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!