Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode 4.4中没有格式安全警告_Xcode_Llvm_String Formatting_Xcode4.4 - Fatal编程技术网

Xcode 4.4中没有格式安全警告

Xcode 4.4中没有格式安全警告,xcode,llvm,string-formatting,xcode4.4,Xcode,Llvm,String Formatting,Xcode4.4,使用Xcode 4.4,我没有从这段代码中得到任何格式安全警告(-Wformat security): #import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { // a = @"%@" or a = @"%@%@" NSString *a = [@"%@" stringByAppendingFormat:@

使用Xcode 4.4,我没有从这段代码中得到任何格式安全警告(
-Wformat security
):

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{

    @autoreleasepool {

        // a = @"%@" or a = @"%@%@"
        NSString *a = [@"%@" stringByAppendingFormat:@"%@", arc4random_uniform(2)? @"%@": @"", nil];

        // 50% change of crash, but no warning
        NSLog(a, @"Hello, World!");

    }
    return 0;
}
#导入
int main(int argc,const char*argv[]
{
@自动释放池{
//a=@“%@”或a=@“%@”
NSString*a=[@“%@”stringByAppendingFormat:@“%@”,arc4random_uniform(2)?@“%@”:“零”;
//50%的碰撞变化,但没有警告
NSLog(一个“你好,世界!”);
}
返回0;
}
这是正常的还是我在Xcode中禁用了这个警告


我刚刚用这段代码创建了这个项目,所以它没有改变默认的项目设置。

Xcode 4.4使用了新版本的LLVM和Clang,以前版本的Xcode是否导致-Wformat security亮起?@jessedc是的,至少在Xcode 4.2中显示了它。我不知道Xcode 4.3。嗯。。。这确实是一个LLVM问题。