警告“使用GNU语句表达式扩展” [英] Warning "Use of GNU statement expression extension"
问题描述
我有这个Objective-C istruction:
NSRange range = NSMakeRange(i,MIN(a,b));
其中 LLVM编译器4.1突出显示了我的指令,显示警告:使用GNU语句表达式扩展。 这是什么意思?这是我的错吗?如果是,我该如何解决呢?如果没有,我该如何清除编译器警告? (在Xcode 5中,我相信你可以通过添加 I have this Objective-C istruction: where During the compilation, the LLVM Compiler 4.1 highlights my instruction showing the warning: "Use of GNU statement expression extension". What does this mean? Is it my fault? If yes, how can I fix it? If not, how can I remove the compiler warning? It’s a late answer, I know, but you can avoid this message by adding (In Xcode 5 I believe you can change this by going to your project’s Build Settings and adding 这篇关于警告“使用GNU语句表达式扩展”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! a
和 b
MIN()
是标准 NSObjCRuntime.h
头文件中定义的宏:
#if!defined(MIN)
#define MIN(A,B)({__typeof __(A)__a =(A); __typeof __(B)__b = < __b?__a:__b;})
#endif
-Wno-gnu
进入您的项目的Build Settings并将 -Wno-gnu
添加到其他C标志,它们在Apple LLVM 5.0 - 自定义编译器标志部分。 )NSRange range = NSMakeRange(i, MIN(a, b));
a
and b
are NSUInteger
s.MIN()
is the macro defined in the standard NSObjCRuntime.h
header file as:#if !defined(MIN)
#define MIN(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __a : __b; })
#endif
-Wno-gnu
to your compiler flags.-Wno-gnu
to the "Other C Flags", which are in the "Apple LLVM 5.0 – Custom Compiler Flags" section.)