Andrej
Andrej

Reputation: 7416

Can't get warnings for unused functions

I'd like Xcode to show a warning if I have unused functions in my project. I'm using Swift.

I went to Project / Build settings and in section Apple LLVM 8.1 - Warnings - All Languages I've set Unused functions to Yes.

enter image description here

But I'm not getting any warning for unused functions in my project.

How can I set Xcode correctly to show me warnings for unused functions?

Upvotes: 5

Views: 920

Answers (1)

Charles Srstka
Charles Srstka

Reputation: 17040

I don't believe that any of those warning flags apply to Swift; they mostly apply to the C-based languages (C, C++, Objective-C). My understanding is that the Swift team wants to avoid creating "dialects" of the language, so all the warnings and errors that the Swift compiler supports are always on, and there aren't really ways to turn individual warnings on or off. So given that, my supposition is that the Swift compiler doesn't currently have any way to check for unused functions.

Upvotes: 1

Related Questions