I'd like the compiler to stop on a given warning, like if it was an error.
The goal is to force taking into account warnings that could be really harmful to the code (not every warning is equal regarding severity)
For exemple, I'd like the compiler to stop on such warnings:
I didn't find any option in the IDE, maybe in the command line compiler?
Delphi 10.3.2
Thanks,
This is documented: Warning messages (Delphi)
You use the compiler directive
{$WARN identifier ERROR}
to treat the warning named identifier
as an error. The documentation page contains a list of all possible warnings. For instance,
{$WARN NO_RETVAL ERROR}
will treat
W1035 Return value of function '%s' might be undefined
as an error.
Update: As Sertac points out, you can also enable this setting globally for the project using Project Options, Bulding, Delphi Compiler, Hints and Warnings, Output warnings.
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