This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ObjC/ObjC++: updated documentation on supported standards, and added -fobjc-std=objc1
- From: IainS <developer at sandoe-acoustics dot co dot uk>
- To: Nicola Pero <nicola dot pero at meta-innovation dot com>
- Cc: "gcc-patches at gnu dot org" <gcc-patches at gnu dot org>
- Date: Tue, 2 Nov 2010 10:07:06 +0000
- Subject: Re: ObjC/ObjC++: updated documentation on supported standards, and added -fobjc-std=objc1
- References: <1288690926.829416922@192.168.2.230>
On 2 Nov 2010, at 09:42, Nicola Pero wrote:
* adds a new -fobjc-std=objc1 option which causes the compiler to
accept only
the Objective-C 1.0 syntax (which for clarity of definition I
defined as the
Objective-C syntax accepted by GCC 4.0);
as we've discussed before, I think this is a very good idea ...
(we will also probably need an -fobjc-abi=)
The option name itself is not set in stone; suggestions I welcome.
I like
-fobjc-std=xxx (as opposed to, say, -fobjc-language-version=1 / -
fobjc-language-version=2)
for consistency with -std=xxx and because we don't know how future
versions of the language
may be named or presented so having a free string there helps to be
adaptable (in the same
way as it works for -std=xxx in C/C++).
.. the only issue with using 'std' is that there are no 'standards' as
such - on the NeXT side the best we could do would be to refer to the
ObjC1 and ObjC2 documents and XCode release notes.
I am not passionately worried by this - but would vote in favor of -
fobjc-language= or even -fobjc-lang= ( to keep the typing to a minimum)
An enumerated short string is much more flexible than a number.
About the short string used to mean 'Objective-C 1.0', I chose
'objc1'. An alternative
would be choosing 'gcc40', so the option could become -fobjc-
std=gcc40. That may be
more accurate, but less obvious (or maybe not).
This looks good and should encompass the pre-Darwin-9 language variant
too.
I'm not sure that naming by gcc release would help the User much - is
there enough objc doc in the tree to be clear about what functionality
is included?
If we needed to make it more fine-grained, for NeXT the logical thing
would be to name by XCode release - since then the documentation is
available (in public).
[but your present suggestion is perfectly good for current needs :-)]
BTW, I also noticed that Darwin-8/NeXT cannot support object
iterators (missing a function in the runtime).
We might need a means to disable that.
cheers,
Iain