警告“使用GNU语句表达式扩展” [英] Warning "Use of GNU statement expression extension"

查看:822
本文介绍了警告“使用GNU语句表达式扩展”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个Objective-C istruction:

  NSRange range = NSMakeRange(i,MIN(a,b)); 

其中 a b

MIN() 是标准 NSObjCRuntime.h 头文件中定义的宏:

  #if!defined(MIN)
#define MIN(A,B)({__typeof __(A)__a =(A); __typeof __(B)__b = < __b?__a:__b;})
#endif

LLVM编译器4.1突出显示了我的指令,显示警告:使用GNU语句表达式扩展。



这是什么意思?这是我的错吗?如果是,我该如何解决呢?如果没有,我该如何清除编译器警告?

解决方案



(在Xcode 5中,我相信你可以通过添加 -Wno-gnu 进入您的项目的Build Settings并将 -Wno-gnu 添加到其他C标志,它们在Apple LLVM 5.0  - 自定义编译器标志部分。 )


I have this Objective-C istruction:

NSRange range = NSMakeRange(i, MIN(a, b));

where a and bare NSUIntegers.

MIN() is the macro defined in the standard NSObjCRuntime.hheader file as:

#if !defined(MIN)
   #define MIN(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __a : __b; })
#endif

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 -Wno-gnu to your compiler flags.

(In Xcode 5 I believe you can change this by going to your project’s Build Settings and adding -Wno-gnu to the "Other C Flags", which are in the "Apple LLVM 5.0 – Custom Compiler Flags" section.)

这篇关于警告“使用GNU语句表达式扩展”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆