How to find a Clang warning flag in Xcode that's not present in build logs

我是研究僧i 提交于 2019-12-07 02:02:22

问题


I've got a warning I wish to suppress in Xcode, but I cannot seem to find the name of the warning. I've enabled -fdiagnostics-show-category=name and the logs show that it's a semantic issue. Looking at Clang's source, I think I've located a test for this scenario but can't seem to track down the name of it.

Currently, the build logs show this:

m:89:29: warning: assigning to 'id<AProtocol>' from incompatible type 'AViewController *' [Semantic Issue]
self.tableView.delegate = self.aController;

The ID for the warning is also 2 - but no matter what I try I cannot seem to make this go away:

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-WNO-CLUE-WHAT-THE-WARNING-FLAG-IS"
    self.tableView.delegate = self.aController;
#pragma clang diagnostic pop

Of course, I'm aware always fixing the warning is preferred, and I can do so with a protocol cast. But at this point, I've looked so hard into finding the warning, it just feels like unfinished business and I'd love to know the answer. I've also searched "freakingclangwarnings.com" and it's not present there either as far as I can tell.


回答1:


Searching source code, I'd guess it's warn_incompatible_qualified_id, defined in DiagnosticSemaKinds.td, which is one of those existing warnings that currently have no associated -W flag Possibly, more information in the revision log from when it was added.



来源:https://stackoverflow.com/questions/38486958/how-to-find-a-clang-warning-flag-in-xcode-thats-not-present-in-build-logs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!