If there is hint or Warning the compiler cancels the compilation

Asked

Viewed 221 times

5

I would like that when compiling an application and if it has any Hint or Warning, the execution is suspended, generating an error.

Does anyone know if it’s possible?

Edit1: Warning’s can be treated as errors. But there is something that can cause Hint’s are also treated as errors?

2 answers

3

Yes it is possible,

Access Project, Option, Delphi Compiler... and in Hints and Warnings you configure..

Ex. Deprected Symbol, when there is a declared and unused variable, it generates a HINT, you can configure it to be an ERROR.

Thus the compilation of the Application had not taken place!

Note. You can configure the Release for this and leave Debug as this. This way the Final Application will be guaranteed without Hints and Warnings.

  • It is possible that a Hint will generate an error?

  • Yes, in the answer I mentioned Ex. Deprected Symbol, quando existe uma variável declarada e não usada, ele gera um HINT, você pode configurar para que seja um ERRO.

  • 1

    Works with Warning, for Hint there is no such option.

2


Every time you click the keys Shift + F9 used to make a Build of the project, a Messages where it is possible to view the hint and warning of the project, where available MISTAKES the Delphi does not allow the project to be executed.

Example with Hint:

Hint

Example with Warning:

Warning

As you mentioned @Júniormoreira to edit Hint and Warning to appear just go on Tab Project -> Options -> Delphi Compiler -> Hints and Warnings.

inserir a descrição da imagem aqui

You can still make a Build to the project by clicking on Tab Project -> Build Project.

EDIT1:

The only options available to choose from are: TRUE or FALSE in the case of Outputs Hints as well as being able to see in the image below: inserir a descrição da imagem aqui

Unlike the Output Warnings who may have the option AS ERRORS can check in the image below: inserir a descrição da imagem aqui

  • It would be interesting for you to quote that your issue was based on my response!

  • @Even though I wrote this in your reply, it is not the only source where I have assured myself how to do it. However I edited my answer and I hope not to have caused big encomudo or arranged a fight. Good weekend

Browser other questions tagged

You are not signed in. Login or sign up in order to post.