p0lAris
p0lAris

Reputation: 4820

Xcode show semantic issue as errors

A simple Xcode warning when there is a type mismatch during an assignment:

Incompatible pointer types assigning to 'TypeA *' from 'TypeB *'

Is there a way to change this setting to throw an error instead of the typical warning?

Update: I don't want all warring to raise build errors. Only warnings that are 'semantic issues' like the one in the example above.

Upvotes: 4

Views: 16641

Answers (2)

Serg Kryvonos
Serg Kryvonos

Reputation: 4677

Yes, there is such an option in build settings. Feel free to use it as shown on the picture. enter image description here

Upvotes: 1

HughV
HughV

Reputation: 86

You can treat warnings as errors. But that isn't selective, if you enable it, you will only get errors.

Select your project and then the target. Next select "Build Settings" and search for "errors". In the "Apple LLVM 6.1 - Warning Policies" section, you should see an item called "Treat Warnings as Errors". Set that to Yes.

Now that warning will generate an error.

Upvotes: 0

Related Questions