Rob Segal
Rob Segal

Reputation: 7625

How do I disable warnings being flagged as errors in Xcode

Is there a setting Xcode that lets you treat warnings NOT as errors in Xcode? I'm doing a lot of prototyping code where I don't care if I have an unused variable for example. Xcode is treating these warnings as errors and it is seriously slowing down my productivity. Can't figure out how to disable this though.

Upvotes: 21

Views: 22649

Answers (4)

Vigneshwaran Murugesan
Vigneshwaran Murugesan

Reputation: 757

I was getting a specific warning being shown as an error in my specific workspace, The above solutions didn't work for me. Then I dug deeper in "Build settings", as I suspected there was "Apple Clang -Warnings - All Languages" where that specified warning was being marked to be shown as error . I had to change it to yes(Error) to yes.

Upvotes: 0

sanjirambo
sanjirambo

Reputation: 53

In your Xcode project Build Settings, search for the flag 'Treat Warnings as Errors' and set it to NO. As the name suggests, if you set it to YES, warnings in that project are counted as Errors.

If you have multiple sub projects, this flag can be toggled for each individual project.

Here is a screenshot from Xcode 13.2.1

Xcode 13.2.1 Treat Warnings as Errors

Upvotes: 1

Kevin Horgan
Kevin Horgan

Reputation: 1580

If you open your project in Xcode, then right click on your target in the Targets folder. Select "Get Info" form the drop down menu and then scroll down to the section for the compiler warnings (GCC 4.0 Warnings on my box). Here you can disable the checkboxes for the various warnings you have active. Also check the value of "Other Warning Flags". This could include -Wall or -WMost which will enable other warnings. You can remove that and hopefully your warnings will not appear.

Good luck!

Upvotes: 8

Nikolai Ruhe
Nikolai Ruhe

Reputation: 81878

In the build settings of your target there's an option named Treat Warnings as Errors. If it is on in your project, turn it off (even though this is the default).

Upvotes: 32

Related Questions