升级xcode9.2之后,编译报错了,如下图所示:![](https://img-blog.csdn.net/20180124142348089?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaHVheXVfaHVheXU=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
报错log: error: expected parameter declarator
check_compile_time(offsetof(IPHeader, totalLength) == 2);
这是使用七牛的库里面的类,如下图所示:
![](https://img-blog.csdn.net/20180124142545811?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaHVheXVfaHVheXU=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
解决方案如下:
1.因为我使用了cocoapods,所以我将QNNetDiag升级到最新版本了就没问题了
pod update QNNetDiag
2.加括号
pod update QNNetDiag
check_compile_time中的参数全部添加括号,如
check_compile_time(sizeof(IPHeader) == 20);
改为
check_compile_time((sizeof(IPHeader) == 20));
3.修改check_compile_time为__Check_Compile_Time可行。