"-Weverything"在每个NSAssert都提出了"Varargs论证失踪,但作为一个扩展被容忍"的警告

Noo*_*low 3 cocoa objective-c llvm clang

在我将新内容添加-Weverything到Clang后other warning flags,我开始收到所有NSAsserts的警告:

Varargs argument missing, but tolerated as an extension
Run Code Online (Sandbox Code Playgroud)

我该如何解决此问题,或者禁止此警告?

Lil*_*ard 8

如果你真的想避免这个警告,请坚持一个nil额外的参数.似乎-Wpedantic不喜欢没有值的varargs参数,所以如果你NSAssert(condition, @"static string")没有为varargs点提供参数(NSAssert看起来像NSAssert(condition, format, ...)).通过坚持nil到底,你为varargs论证提供了一个价值,但它没有任何成本.