Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi 2009 where is the 'treat warnings as errors' option?

In Delphi 2009 whereabouts do you turn on the option to treat warnings as errors?

like image 570
Jamie Avatar asked Nov 06 '08 09:11

Jamie


2 Answers

Just found the answer soon after I posted this! Might be useful for other people.

Navigate to 'Project -> Options - > Delphi Compiler -> Hints and Warnings' and change the value of 'Output Warnings' to 'as errors'

I was looking for an option similar to what Visual Studio has

like image 179
Jamie Avatar answered Sep 20 '22 18:09

Jamie


On a related note, if you are using the command line compiler (DCC32.exe) the switch is -W^ to have warnings treated as errors. If you are using this, it's important to note that the default command shell in Windows (cmd.exe) treats the caret (^) as an escape character, so you have to use -W^^ instead if you are executing the compiler directly from the command line, a batch file or even the from the Pre-Build or Post-Build events in the IDE.

It's also worth mentioning that you can have only certain warnings treated as errors. The switch to do this on the command line would look something like this: -W^^WARNING-NAME. You would substitute the string that is associated with the warning you are wanting to have treated as an error.

like image 26
Mark Edington Avatar answered Sep 20 '22 18:09

Mark Edington