In Delphi 2009 whereabouts do you turn on the option to treat warnings as errors?
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
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.
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