如何在Linux下检查GCC对Objective 2.0的支持? [英] How to check for Objective 2.0 support by GCC under linux?

查看:64
本文介绍了如何在Linux下检查GCC对Objective 2.0的支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在linux下,并且都来自svn主干的 clang 3.5 gcc 4.8.1 。我不能用 gcc 编译 objective-c 2.0 代码,但我可以用 clang

I'm under linux and I have both clang 3.5, from the svn trunk, and gcc 4.8.1. It surprises me that I can't compile objective-c 2.0 code with gcc but I can do that with clang.

我知道 gcc 是默认的编译器 clang 出现之前, MAC OS X 很长一段时间。那么,为什么 gcc 在Linux下不支持 obj-c 2.0

I know that gcc was the default compiler on MAC OS X for a long time before the coming of clang. So why gcc doesn't support obj-c 2.0 under linux?

clang 甚至可以与GNUstep一起使用,其中 gcc 的实现确实跟不上

clang even works fine with GNUstep, where gcc really can't keep up in terms of implemented features from the version 2.0 of the language.

例如, autoreleasepool 关键字不受<$ c支持$ c> gcc 。

推荐答案

这实际上取决于您所说的 Objective-C 2.0 。没有正式的书面规范。

This really depends on what you mean by "Objective-C 2.0". There's no official written specification.

您可能会认为 Objective-C 2.0的几种语言功能仅由clang支持,而从未由gcc支持。其中包括ARC, NSNumber / NSArray / NSDictionary 文字,和对象下标。 @autoreleasepool 语法是ARC的一部分。

Several language features that you probably think of as "Objective-C 2.0" are only supported by clang and have never been supported by gcc. These include ARC, NSNumber/NSArray/NSDictionary literals, and object subscripting. The @autoreleasepool syntax is part of ARC.

这篇关于如何在Linux下检查GCC对Objective 2.0的支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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