Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't get warnings for unused functions

Tags:

xcode

swift

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?

like image 666
Andrej Avatar asked Nov 08 '22 17:11

Andrej


1 Answers

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.

like image 134
Charles Srstka Avatar answered Nov 22 '22 07:11

Charles Srstka