Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force Delphi compiler to display all hints and warnings

Is there a way to force the Delphi compiler to display all hints and warnings all the time?

Here is the behavior that I am currently seeing in Delphi 6:

  1. Check out fresh copy of my application from source control
  2. Open project in Delphi and Compile
  3. All hints and warnings for the project are displayed
  4. Make a change in one unit
  5. Compile
  6. Only the hints and warnings for the changed unit are displayed

So, I thought maybe I can trick Delphi by deleting all of the dcu files to force it to recompile everything. No luck. The compiler does in fact recompile all of the units, but does not display the hints and warnings for those units.

EDIT: Performing a full build (Project > Build) yields the same unfortunate results.

NEW INFORMATION: If I modify a unit and then Compile, I get the warnings. However, if I modify a unit and then Build, I do not get the warnings. I'm thinking this points to warnings being turned off somewhere. Possibly in a third party library?

It seems there ought to be a way to ask Delphi to re-display all of those hints and warnings that doesn't require me to either check out a fresh copy from source control or modify each unit one-by-one.

like image 337
Scott W Avatar asked Jun 10 '09 20:06

Scott W


2 Answers

Hints and Warnings are generated by the compiler. It will only report on units that it has compiled. The "compile" command will only compile files that have changed. To force a recompilation of all units used by your project, use the Build command instead.

Later versions assign a shortcut key (Shift+F9) to the "Build" command.

To get that keyboard shortcut in Delphi 6, install this utility, which I've used for a while with great success on Delphi 5.

like image 73
JosephStyons Avatar answered Oct 26 '22 12:10

JosephStyons


I would check to see if you turn the warnings off in some of your units.
Depending on the last change in the units, the compiling order can change. In some cases the warnings can remain disabled for a unit that is compiled after while, when freshly checked out of version control, it was compiled before, with the warnings.
Pay extra attention to any Include file you may use.

like image 37
Francesca Avatar answered Oct 26 '22 11:10

Francesca