llvm-4.0

Warning “Use of GNU statement expression extension”

徘徊边缘 提交于 2019-12-18 19:38:12
问题 I have this Objective-C istruction: NSRange range = NSMakeRange(i, MIN(a, b)); where 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 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

clang-analyzer-alpha.unix.PthreadLock check missing from clang-tidy version 3.8 and 4.0?

£可爱£侵袭症+ 提交于 2019-12-12 02:33:07
问题 I am trying to modernize my module's C++ source code using clang-tidy. A few weeks ago, I downloaded and built clang and clang tools version 3.9 and when I ran it on one of my cpp files I got clang-analyzer-alpha.unix.PthreadLock saying that lock has already been taken. Later, because of space constraints I removed that version of clang and used version 3.8 and 4.0 available in our 3rd party repos. In both of these versions, I did not get any warnings regarding this alpha check. How do I

Literal @YES not working in iOS 5 / Xcode 4.4

元气小坏坏 提交于 2019-11-29 10:02:00
New Xcode 4.4 is out and it should support literals like @42 @"String" @23.0L @{ @"key" : obj } and @[obj1, obj2] and it should also support @YES and @NO , which isn't working when targeting latest iOS 5 (and prior). After compiling it show the error message: Unexpected type name 'BOOL': expected expression I know you can fix it by typing @(YES) and @(NO) . But I want to know the reason why it isn't working as expected. The reason is Apple forgot the parentheses here: #define YES (BOOL)1 This will be fixed in iOS 6 SDK: #define YES ((BOOL)1) In the meantime you must type @(YES) . James Webster

Literal @YES not working in iOS 5 / Xcode 4.4

偶尔善良 提交于 2019-11-28 03:18:28
问题 New Xcode 4.4 is out and it should support literals like @42 @"String" @23.0L @{ @"key" : obj } and @[obj1, obj2] and it should also support @YES and @NO , which isn't working when targeting latest iOS 5 (and prior). After compiling it show the error message: Unexpected type name 'BOOL': expected expression I know you can fix it by typing @(YES) and @(NO) . But I want to know the reason why it isn't working as expected. 回答1: The reason is Apple forgot the parentheses here: #define YES (BOOL)1