iOS __typeof typeof
2016-04-01 09:44
357 查看
As others have mentioned,
If you happen to be writing Objective-C for iOS or Mac apps, chances are good that you will be compiling your app with the Clang compiler.
Clang does support the use of
Now if you're writing your code with Xcode, the default setting for the C language dialect appears to be GNU99 and the option of allowing 'asm' 'inline' 'typeof' is set to Yes, so using
If you want to be (arguably) safer when using the Clang compiler, use
typeof()is an extension of C that has various support in respective compilers.
If you happen to be writing Objective-C for iOS or Mac apps, chances are good that you will be compiling your app with the Clang compiler.
Clang does support the use of
typeof(), but technically it's for when your C Language Dialect is set to be a gnu* type. However
__typeof__()is supported in both c* and gnu* language dialects - as detailed in the Clang documentation.
Now if you're writing your code with Xcode, the default setting for the C language dialect appears to be GNU99 and the option of allowing 'asm' 'inline' 'typeof' is set to Yes, so using
typeof()won't bring you any problems.
If you want to be (arguably) safer when using the Clang compiler, use
__typeof__(). This way you won't be affected if the C Language Dialect being used for compilation changes or if someone decides to turn off the allowance of 'typeof'.
相关文章推荐
- iOS 页面跳转性能优化
- iOS App设计模式开发中对建造者模式的运用实例
- ios 内存管理与property copy strong weak assign
- iOS如何在Xcode7中手动添加Precompile Prefix Header?
- ios开发--企业帐号发布
- iOS 计算字符串高度
- iOS微博项目(二)
- iOS 图片大小压缩 图片尺寸处理
- 【代码笔记】iOS-检测手机翻转
- iOS中堆和栈的区别
- iOS 自定义弹出视图 几行代码可以自定义任何弹出视图
- iOS开发:strong属性与weak属性的区别
- iOS 后台线程
- 【iOS】idfa查找
- iOS 截屏并保存在本地
- iOS状态栏颜色修改
- AutoLayout三个重要的概念
- 适配iPad和iPhone
- CocoaPods + 自定义静态库 -> 多工程连编
- IOS博客项目搭建-09-OAuth02授权