我想在 Xcode 中开发 iPhone 应用程序时抑制特定警告。警告是:
"warning: class 'XXX' does not implement the 'XYZ' protocol"
我知道我使用指令:
#pragma GCC diagnostic warning "-Wxxxxxxxxxxxx"
但我不知道 xxxxxxxxxxxx 应该是什么。有任何想法吗?
(假设:这样做是有正当理由的。我需要这样做,否则我无法启用将警告视为错误选项。)
最佳答案
如果问题只是您不能使用 -Werror
然后使用 -Wno-protocol
禁用该特定警告。并非所有警告都可以通过编译指示禁用。
关于xcode - 在 GCC 中抑制 "does not implement protocol"警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4140526/