Message ID | 1289986290.375121733@192.168.2.229 |
---|---|
State | New |
Headers | show |
On 17 Nov 2010, at 09:31, Nicola Pero wrote: > This patch updates the wwwdocs with the changes that were done > for Objective-C and Objective-C++ for GCC 4.6. There's quite a lot > of stuff :-) ... and I didn't include all the bugfixes. maybe we don't need to include all - but we might mention that ObjC* now supports LTO. and, perhaps that FSF gcc/ObjC* can, once again, build m32 NeXT runtime on Darwin. (but those could be a later amendment - not urgent). > Two things to note: > > * @property + @optional is known not to work properly yet, but it's > a bug and we'll fix it before release; I didn't mention it in the > release > notes. > > * I had to mention in the release notes that we now parse ObjC 2.0 > class/protocol attributes but don't implement them. That is the > honest > state of affairs but actually looks bad on release notes; it would > only take > me a few hours to fix that and complete the implementation so I > think I'll do > that hopefully in the next week or so when I get a bit of time. > Then we can > amend the release notes and say that these are implemented too. > Anyway, for > now it's fair to say that they are parsed but not implemented. ;-) Seems like you will get there before me ... ... I'm still bogged down in some platform-related bug fixing. Looks good tho' :-) > > Ok to commit ? > > Thanks > > Index: changes.html > =================================================================== > RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.6/changes.html,v > retrieving revision 1.58 > diff -u -r1.58 changes.html > --- changes.html 7 Nov 2010 13:48:21 -0000 1.58 > +++ changes.html 17 Nov 2010 09:11:46 -0000 > @@ -293,6 +293,125 @@ > > <h3>Java (GCJ)</h3> > > +<h3 id="objective-c">Objective-C and Objective-C++</h3> > + > + <ul> > + <li>The <code>-fobjc-excceptions</code> flag is now required to > + enable Objective-C exception and synchronization syntax > + (introduced by the keywords <code>@try</code>, > + <code>@catch</code>, <code>@finally</code> and > + <code>@synchronized</code>).</li> > + > + <li>A number of Objective-C 2.0 features and extensions are now > + supported by GCC. These features are enabled by default; you can > + disable them by using the new <code>-fobjc-std=objc1</code> > + command-line option.</li> > + > + <li>The Objective-C 2.0 dot-syntax is now supported both in > + Objective-C and Objective-C++. The dot-syntax is an alternative > + syntax for using getters and setters; <code>object.count</code> > is > + automatically converted into <code>[object count]</code> or > + <code>[object setCount: ...]</code> depending on context; for > + example <code>if (object.count > 0)</code> is automatically > + compiled into the equivalent of <code>if ([object count] > > + 0)</code> while <code>object.count = 0;</code> is automatically > + compiled into the equivalent ot <code>[object setCount: > + 0];</code>. The dot-syntax can be used with instance and class > + objects and with any setters or getters, no matter if they are > + part of a declared property or not.</li> > + > + <li>Objective-C 2.0 declared properties are now supported both in > + Objective-C and Objective-C++. Declared properties are declared > + using the new <code>@property</code> keyword, and are most > + commonly used in conjunction with the new Objective-C 2.0 > + dot-syntax. The <code>nonatomic</code>, <code>readonly</code>, > + <code>readwrite</code>, <code>assign</code>, <code>retain</code>, > + <code>copy</code>, <code>setter</code> and <code>getter</code> > + attributes are all supported. Marking declared properties with > + <code>__attribute__ ((deprecated))</code> is supported too.</li> > + > + <li>The Objective-C 2.0 <code>@synthesize</code> and > + <code>@dynamic</code> keywords are supported both in Objective-C > + and Objective-C++. <code>@synthesize</code> causes the compiler > + to automatically synthesize a declared property, while > + <code>@dynamic</code> is used to disable all warnings for a > + declared property for which no implementation is provided at > + compile time. Synthesizing declared properties requires runtime > + support in most useful cases; to be able to use it with the GNU > + runtime, appropriate helper functions have been added to the GNU > + Objective-C runtime ABI, and are implemented by the GNU > + Objective-C runtime library shipped with GCC.</li> > + > + <li>The Objective-C 2.0 fast enumeration syntax is supported in > + Objective-C. This is currently not yet available in > + Objective-C++. Fast enumeration requires support in the runtime, > + and such support has been added to the GNU Objective-C runtime > + library (shipped with GCC).</li> > + > + <li>The Objective-C 2.0 <code>@optional</code> keyword is > + supported in Objective-C and Objective-C++. This keyword allows > + you to mark methods or properties in a protocol as optional as > + opposed to required.</li> > + > + <li>The Objective-C 2.0 <code>@package</code> keyword is > + supported in Objective-C and Objective-C++. This keyword has > + currently the same effect as the <code>@public</code> > + keyword.</li> > + > + <li>Objective-C 2.0 method attributes are supported both in > + Objective-C and Objective-C++. Currently the supported > attributes > + are <code>deprecated</code>, <code>sentinel</code>, > + <code>noreturn</code> and <code>format</code>.</li> > + > + <li>Objective-C 2.0 method argument attributes are supported > + both in Objective-C and Objective-C++. The most widely used > + attribute is <code>unused</code>, to mark an argument as unused > in > + the implementation.</li> > + > + <li>Objective-C 2.0 class and protocol attributes are parsed both > + in Objective-C and Objective-C++, but are ignored.</li> > + </ul> > + > + <h4>Runtime Library (libobjc)</h4> > + > + <ul> > + <li>The GNU Objective-C runtime library now defines the macro > + <code>__GNU_LIBOBJC__</code> (with a value that is increased at > + every release where there is any change to the API) in > + <code>objc/objc.h</code> making it easy to determine if the GNU > + Objective-C runtime library is being used, and if so, which > + version. Previous versions of the GNU Objective-C library (and > + other Objective-C runtime libraries such as the Apple one) do not > + define this macro.</li> > + > + <li>A new Objective-C 2.0 API, almost identical to the one > + implemented by the Apple Objective-C runtime, has been > implemented > + in the GNU Objective-C runtime library. The new API hides the > + internals of most runtime structures but provides a more > extensive > + set of functions to operate on them. It is much easier, for > + example, to create or modify classes at runtime. The new API > also > + makes it easier to port software from Apple to GNU as almost no > + changes should be required. The old API is still supported for > + backwards compatibility; including the old > + <code>objc/objc-api.h</code> header file automatically selects > the > + old API, while including the new <code>objc/runtime.h</code> > + header file automatically selects the new API. Support for the > + old API is being phased out and upgrading the software to use the > + new API is strongly recommended. To check for the availability > of > + the new API, the <code>__GNU_LIBOBJC_</code> macro can be used as > + older versions of the GNU Objective-C library, which do not > + support the new API, do not define such a macro.</li> > + > + <li>Runtime support for <code>@synchronized</code> has been added > + to the runtime.</li> > + > + <li>Runtime support for Objective-C 2.0 synthesized property > + accessors has been added to the runtime.</li> > + > + <li>Runtime support for Objective-C 2.0 fast enumeration has been > + added to the runtime.</li> > + </ul> > + > <h2 id="targets">New Targets and Target Specific Improvements</h2> > > <h3>IA-32/x86-64</h3> > >
>> This patch updates the wwwdocs with the changes that were done >> for Objective-C and Objective-C++ for GCC 4.6. There's quite a lot >> of stuff :-) ... and I didn't include all the bugfixes. > > maybe we don't need to include all I don't see why not - interested users benefit a lot from well-formatted and well-organized lists of changes. They are usually very eager to read such a list (as confirmed by the fact that we got people posting on the mailing list asking precisely for a list of the Objective-C changes in GCC 4.6.0!). They shouldn't have to go through ChangeLogs to figure out if ObjC method arguments are now supported or not. ;-) Users who are not interested in Objective-C/Objective-C++ will just skip the section. > - but we might mention that ObjC* now supports LTO. > and, perhaps that FSF gcc/ObjC* can, once again, build m32 NeXT > runtime on Darwin. Ok - good idea - here's a modified patch where I added a mention of these. I think the "can build m32 NeXT runtime on Darwin" would be very important/interesting for users, so I put it towards the top of the list ... in fact, at the very top, just after the mention of the command-line argument changes. I wasn't aware of changes in Objective-C wrt LTO (other than some bugfixes) but presumably these happened 6 months ago or so when I wasn't paying attention to GCC. Anyway, I added a mention of that as you suggested. (the revised patch below also fixes a couple of places where I had written 'GNU Objective-C library' instead of 'GNU Objective-C runtime library') Ok to commit ? Thanks <h3 id="objective-c">Objective-C and Objective-C++</h3> <ul> <li>The <code>-fobjc-excceptions</code> flag is now required to enable Objective-C exception and synchronization syntax (introduced by the keywords <code>@try</code>, <code>@catch</code>, <code>@finally</code> and <code>@synchronized</code>).</li> <li>A number of Objective-C 2.0 features and extensions are now supported by GCC. These features are enabled by default; you can disable them by using the new <code>-fobjc-std=objc1</code> command-line option.</li> <li>GCC can now be used to build Objective-C and Objective-C++ software that uses the m32 NeXT runtime on Darwin.</li> <li>The Objective-C 2.0 dot-syntax is now supported both in Objective-C and Objective-C++. The dot-syntax is an alternative syntax for using getters and setters; <code>object.count</code> is automatically converted into <code>[object count]</code> or <code>[object setCount: ...]</code> depending on context; for example <code>if (object.count > 0)</code> is automatically compiled into the equivalent of <code>if ([object count] > 0)</code> while <code>object.count = 0;</code> is automatically compiled into the equivalent ot <code>[object setCount: 0];</code>. The dot-syntax can be used with instance and class objects and with any setters or getters, no matter if they are part of a declared property or not.</li> <li>Objective-C 2.0 declared properties are now supported both in Objective-C and Objective-C++. Declared properties are declared using the new <code>@property</code> keyword, and are most commonly used in conjunction with the new Objective-C 2.0 dot-syntax. The <code>nonatomic</code>, <code>readonly</code>, <code>readwrite</code>, <code>assign</code>, <code>retain</code>, <code>copy</code>, <code>setter</code> and <code>getter</code> attributes are all supported. Marking declared properties with <code>__attribute__ ((deprecated))</code> is supported too.</li> <li>The Objective-C 2.0 <code>@synthesize</code> and <code>@dynamic</code> keywords are supported both in Objective-C and Objective-C++. <code>@synthesize</code> causes the compiler to automatically synthesize a declared property, while <code>@dynamic</code> is used to disable all warnings for a declared property for which no implementation is provided at compile time. Synthesizing declared properties requires runtime support in most useful cases; to be able to use it with the GNU runtime, appropriate helper functions have been added to the GNU Objective-C runtime ABI, and are implemented by the GNU Objective-C runtime library shipped with GCC.</li> <li>The Objective-C 2.0 fast enumeration syntax is supported in Objective-C. This is currently not yet available in Objective-C++. Fast enumeration requires support in the runtime, and such support has been added to the GNU Objective-C runtime library (shipped with GCC).</li> <li>The Objective-C 2.0 <code>@optional</code> keyword is supported in Objective-C and Objective-C++. This keyword allows you to mark methods or properties in a protocol as optional as opposed to required.</li> <li>The Objective-C 2.0 <code>@package</code> keyword is supported in Objective-C and Objective-C++. This keyword has currently the same effect as the <code>@public</code> keyword.</li> <li>Objective-C 2.0 method attributes are supported both in Objective-C and Objective-C++. Currently the supported attributes are <code>deprecated</code>, <code>sentinel</code>, <code>noreturn</code> and <code>format</code>.</li> <li>Objective-C 2.0 method argument attributes are supported both in Objective-C and Objective-C++. The most widely used attribute is <code>unused</code>, to mark an argument as unused in the implementation.</li> <li>Objective-C 2.0 class and protocol attributes are parsed both in Objective-C and Objective-C++, but are ignored.</li> <li>GCC now supports LTO when compiling Objective-C and Objective-C++.</li> </ul> <h4>Runtime Library (libobjc)</h4> <ul> <li>The GNU Objective-C runtime library now defines the macro <code>__GNU_LIBOBJC__</code> (with a value that is increased at every release where there is any change to the API) in <code>objc/objc.h</code> making it easy to determine if the GNU Objective-C runtime library is being used, and if so, which version. Previous versions of the GNU Objective-C runtime library (and other Objective-C runtime libraries such as the Apple one) do not define this macro.</li> <li>A new Objective-C 2.0 API, almost identical to the one implemented by the Apple Objective-C runtime, has been implemented in the GNU Objective-C runtime library. The new API hides the internals of most runtime structures but provides a more extensive set of functions to operate on them. It is much easier, for example, to create or modify classes at runtime. The new API also makes it easier to port software from Apple to GNU as almost no changes should be required. The old API is still supported for backwards compatibility; including the old <code>objc/objc-api.h</code> header file automatically selects the old API, while including the new <code>objc/runtime.h</code> header file automatically selects the new API. Support for the old API is being phased out and upgrading the software to use the new API is strongly recommended. To check for the availability of the new API, the <code>__GNU_LIBOBJC_</code> macro can be used as older versions of the GNU Objective-C runtime library, which do not support the new API, do not define such a macro.</li> <li>Runtime support for <code>@synchronized</code> has been added to the runtime.</li> <li>Runtime support for Objective-C 2.0 synthesized property accessors has been added to the runtime.</li> <li>Runtime support for Objective-C 2.0 fast enumeration has been added to the runtime.</li> </ul>
On 17 Nov 2010, at 10:13, Nicola Pero wrote: > >>> This patch updates the wwwdocs with the changes that were done >>> for Objective-C and Objective-C++ for GCC 4.6. There's quite a lot >>> of stuff :-) ... and I didn't include all the bugfixes. >> >> maybe we don't need to include all > > I don't see why not - interested users benefit a lot from well- > formatted > and well-organized lists of changes. I meant "I don't think we need mention all bug-fixes" ;-) [Of course, the enhancements are very important - I was not suggesting to leave any out!] > They are usually very eager to read > such a list (as confirmed by the fact that we got people posting on > the > mailing list asking precisely for a list of the Objective-C changes > in GCC 4.6.0!). > They shouldn't have to go through ChangeLogs to figure out if ObjC > method > arguments are now supported or not. ;-) > > Users who are not interested in Objective-C/Objective-C++ will just > skip > the section. > >> - but we might mention that ObjC* now supports LTO. >> and, perhaps that FSF gcc/ObjC* can, once again, build m32 NeXT >> runtime on Darwin. > > Ok - good idea - here's a modified patch where I added a mention of > these. > I think the "can build m32 NeXT runtime on Darwin" would be very > important/interesting > for users, so I put it towards the top of the list ... in fact, at > the very top, > just after the mention of the command-line argument changes. > > I wasn't aware of changes in Objective-C wrt LTO (other than some > bugfixes) > but presumably these happened 6 months ago or so when I wasn't > paying attention > to GCC. Anyway, I added a mention of that as you suggested. well, this is a bug-fix - but an important one. > > (the revised patch below also fixes a couple of places where I had > written 'GNU Objective-C > library' instead of 'GNU Objective-C runtime library') > > Ok to commit ? > > Thanks > > <h3 id="objective-c">Objective-C and Objective-C++</h3> > > <ul> > <li>The <code>-fobjc-excceptions</code> flag is now required to > enable Objective-C exception and synchronization syntax > (introduced by the keywords <code>@try</code>, > <code>@catch</code>, <code>@finally</code> and > <code>@synchronized</code>).</li> > > <li>A number of Objective-C 2.0 features and extensions are now > supported by GCC. These features are enabled by default; you can > disable them by using the new <code>-fobjc-std=objc1</code> > command-line option.</li> > move this ... > <li>GCC can now be used to build Objective-C and Objective-C++ > software that uses the m32 NeXT runtime on Darwin.</li> > > <li>The Objective-C 2.0 dot-syntax is now supported both in > Objective-C and Objective-C++. The dot-syntax is an alternative > syntax for using getters and setters; <code>object.count</code> is > automatically converted into <code>[object count]</code> or > <code>[object setCount: ...]</code> depending on context; for > example <code>if (object.count > 0)</code> is automatically > compiled into the equivalent of <code>if ([object count] > > 0)</code> while <code>object.count = 0;</code> is automatically > compiled into the equivalent ot <code>[object setCount: > 0];</code>. The dot-syntax can be used with instance and class > objects and with any setters or getters, no matter if they are > part of a declared property or not.</li> > > <li>Objective-C 2.0 declared properties are now supported both in > Objective-C and Objective-C++. Declared properties are declared > using the new <code>@property</code> keyword, and are most > commonly used in conjunction with the new Objective-C 2.0 > dot-syntax. The <code>nonatomic</code>, <code>readonly</code>, > <code>readwrite</code>, <code>assign</code>, <code>retain</code>, > <code>copy</code>, <code>setter</code> and <code>getter</code> > attributes are all supported. Marking declared properties with > <code>__attribute__ ((deprecated))</code> is supported too.</li> > > <li>The Objective-C 2.0 <code>@synthesize</code> and > <code>@dynamic</code> keywords are supported both in Objective-C > and Objective-C++. <code>@synthesize</code> causes the compiler > to automatically synthesize a declared property, while > <code>@dynamic</code> is used to disable all warnings for a > declared property for which no implementation is provided at > compile time. Synthesizing declared properties requires runtime > support in most useful cases; to be able to use it with the GNU > runtime, appropriate helper functions have been added to the GNU > Objective-C runtime ABI, and are implemented by the GNU > Objective-C runtime library shipped with GCC.</li> > > <li>The Objective-C 2.0 fast enumeration syntax is supported in > Objective-C. This is currently not yet available in > Objective-C++. Fast enumeration requires support in the runtime, > and such support has been added to the GNU Objective-C runtime > library (shipped with GCC).</li> > > <li>The Objective-C 2.0 <code>@optional</code> keyword is > supported in Objective-C and Objective-C++. This keyword allows > you to mark methods or properties in a protocol as optional as > opposed to required.</li> > > <li>The Objective-C 2.0 <code>@package</code> keyword is > supported in Objective-C and Objective-C++. This keyword has > currently the same effect as the <code>@public</code> > keyword.</li> > > <li>Objective-C 2.0 method attributes are supported both in > Objective-C and Objective-C++. Currently the supported attributes > are <code>deprecated</code>, <code>sentinel</code>, > <code>noreturn</code> and <code>format</code>.</li> > > <li>Objective-C 2.0 method argument attributes are supported > both in Objective-C and Objective-C++. The most widely used > attribute is <code>unused</code>, to mark an argument as unused in > the implementation.</li> > > <li>Objective-C 2.0 class and protocol attributes are parsed both > in Objective-C and Objective-C++, but are ignored.</li> ... to here and maybe re-word a little: <li>As a result of these enhancements, GCC can now be used to build Objective-C and Objective-C++ software that uses Foundation and other important system frameworks with the NeXT runtime on Darwin 9 and Darwin 10 (OSX 10.5 and 10.6). Currently this is for m32 code only.</li> > <li>GCC now supports LTO when compiling Objective-C and > Objective-C++.</li> ??? maybe == <li>A serious bug was fixed that was preventing LTO when compiling Objective-C and Objective-C++.</li> == or perhaps a separate section for 'important' bug-fixes (as I said, we could leave that for now). > </ul> > > <h4>Runtime Library (libobjc)</h4> > > <ul> > <li>The GNU Objective-C runtime library now defines the macro > <code>__GNU_LIBOBJC__</code> (with a value that is increased at > every release where there is any change to the API) in > <code>objc/objc.h</code> making it easy to determine if the GNU > Objective-C runtime library is being used, and if so, which > version. Previous versions of the GNU Objective-C runtime library > (and other Objective-C runtime libraries such as the Apple one) do > not define this macro.</li> > > <li>A new Objective-C 2.0 API, almost identical to the one > implemented by the Apple Objective-C runtime, has been implemented > in the GNU Objective-C runtime library. The new API hides the > internals of most runtime structures but provides a more extensive > set of functions to operate on them. It is much easier, for > example, to create or modify classes at runtime. The new API also > makes it easier to port software from Apple to GNU as almost no > changes should be required. The old API is still supported for > backwards compatibility; including the old > <code>objc/objc-api.h</code> header file automatically selects the > old API, while including the new <code>objc/runtime.h</code> > header file automatically selects the new API. Support for the > old API is being phased out and upgrading the software to use the > new API is strongly recommended. To check for the availability of > the new API, the <code>__GNU_LIBOBJC_</code> macro can be used as > older versions of the GNU Objective-C runtime library, which do > not support the new API, do not define such a macro.</li> > > <li>Runtime support for <code>@synchronized</code> has been added > to the runtime.</li> > > <li>Runtime support for Objective-C 2.0 synthesized property > accessors has been added to the runtime.</li> > > <li>Runtime support for Objective-C 2.0 fast enumeration has been > added to the runtime.</li> > </ul> > >
On Nov 17, 2010, at 2:13 AM, Nicola Pero wrote: > Ok to commit ? Ok. > <li>Objective-C 2.0 class and protocol attributes are parsed both > in Objective-C and Objective-C++, but are ignored.</li> If the words are not implemented apply, then I prefer the phrasing, <li>Objective-C 2.0 class and protocol attributes are not implemented, presently they are just ignored.
>> <li>Objective-C 2.0 class and protocol attributes are parsed both >> in Objective-C and Objective-C++, but are ignored.</li> > > If the words are not implemented apply, then I prefer the phrasing, <li>Objective-C 2.0 class and protocol attributes are not implemented, presently they are just ignored. Thanks a lot for your feedback. I have incorporated both IainS's and Mike's changes (including some changes that IainS suggested in private emails). :-) Hopefully I'll finish the implementation of Objective-C 2.0 class and protocol attributes before the release and we can remove the clumsy sentence about these being not implemented but ignored. ;-) At the end of this email the exact text I committed. There should be no surprises but I'm happy to make more changes if anyone has any additional suggestions. :-) I actually would like to maybe suggest that we put a two line summary on this on the GCC news front page - mostly to make a statement about FSF GCC's commitment to support Objective-C going forward. Some people keep rumouring about the FSF GCC's lack of commitment to Objective-C. These rumours are in my opinion unfounded as I found everyone in GCC to be very helpful when I started to work on improving the Objective-C compiler and I'd like to suggest that a good way to stop the rumours would be to show some official project support for Objective-C on the front page. :-) Thanks <h3 id="objective-c">Objective-C and Objective-C++</h3> <ul> <li>The <code>-fobjc-exceptions</code> flag is now required to enable Objective-C exception and synchronization syntax (introduced by the keywords <code>@try</code>, <code>@catch</code>, <code>@finally</code> and <code>@synchronized</code>).</li> <li>A number of Objective-C 2.0 features and extensions are now supported by GCC. These features are enabled by default; you can disable them by using the new <code>-fobjc-std=objc1</code> command-line option.</li> <li>The Objective-C 2.0 dot-syntax is now supported both in Objective-C and Objective-C++. The dot-syntax is an alternative syntax for using getters and setters; <code>object.count</code> is automatically converted into <code>[object count]</code> or <code>[object setCount: ...]</code> depending on context; for example <code>if (object.count > 0)</code> is automatically compiled into the equivalent of <code>if ([object count] > 0)</code> while <code>object.count = 0;</code> is automatically compiled into the equivalent ot <code>[object setCount: 0];</code>. The dot-syntax can be used with instance and class objects and with any setters or getters, no matter if they are part of a declared property or not.</li> <li>Objective-C 2.0 declared properties are now supported both in Objective-C and Objective-C++. Declared properties are declared using the new <code>@property</code> keyword, and are most commonly used in conjunction with the new Objective-C 2.0 dot-syntax. The <code>nonatomic</code>, <code>readonly</code>, <code>readwrite</code>, <code>assign</code>, <code>retain</code>, <code>copy</code>, <code>setter</code> and <code>getter</code> attributes are all supported. Marking declared properties with <code>__attribute__ ((deprecated))</code> is supported too.</li> <li>The Objective-C 2.0 <code>@synthesize</code> and <code>@dynamic</code> keywords are supported both in Objective-C and Objective-C++. <code>@synthesize</code> causes the compiler to automatically synthesize a declared property, while <code>@dynamic</code> is used to disable all warnings for a declared property for which no implementation is provided at compile time. Synthesizing declared properties requires runtime support in most useful cases; to be able to use it with the GNU runtime, appropriate helper functions have been added to the GNU Objective-C runtime ABI, and are implemented by the GNU Objective-C runtime library shipped with GCC.</li> <li>The Objective-C 2.0 fast enumeration syntax is supported in Objective-C. This is currently not yet available in Objective-C++. Fast enumeration requires support in the runtime, and such support has been added to the GNU Objective-C runtime library (shipped with GCC).</li> <li>The Objective-C 2.0 <code>@optional</code> keyword is supported in Objective-C and Objective-C++. This keyword allows you to mark methods or properties in a protocol as optional as opposed to required.</li> <li>The Objective-C 2.0 <code>@package</code> keyword is supported in Objective-C and Objective-C++. This keyword has currently the same effect as the <code>@public</code> keyword.</li> <li>Objective-C 2.0 method attributes are supported both in Objective-C and Objective-C++. Currently the supported attributes are <code>deprecated</code>, <code>sentinel</code>, <code>noreturn</code> and <code>format</code>.</li> <li>Objective-C 2.0 method argument attributes are supported both in Objective-C and Objective-C++. The most widely used attribute is <code>unused</code>, to mark an argument as unused in the implementation.</li> <li>Objective-C 2.0 class and protocol attributes are not implemented, presently they are just ignored.</li> <li>As a result of these enhancements, GCC can now be used to build Objective-C and Objective-C++ software that uses Foundation and other important system frameworks with the NeXT runtime on Darwin 9 and Darwin 10 (OSX 10.5 and 10.6). Currently this is for m32 code only.</li> <li>Many bugs in the Objective-C and Objective-C++ compiler have been fixed in this release; in particular, LTO can now be used when compiling Objective-C and Objective-C++ and the Objective-C and Objective-C++ parsers are much more robust in dealing with invalid code.</li> </ul> <h4>Runtime Library (libobjc)</h4> <ul> <li>The GNU Objective-C runtime library now defines the macro <code>__GNU_LIBOBJC__</code> (with a value that is increased at every release where there is any change to the API) in <code>objc/objc.h</code> making it easy to determine if the GNU Objective-C runtime library is being used, and if so, which version. Previous versions of the GNU Objective-C runtime library (and other Objective-C runtime libraries such as the Apple one) do not define this macro.</li> <li>A new Objective-C 2.0 API, almost identical to the one implemented by the Apple Objective-C runtime, has been implemented in the GNU Objective-C runtime library. The new API hides the internals of most runtime structures but provides a more extensive set of functions to operate on them. It is much easier, for example, to create or modify classes at runtime. The new API also makes it easier to port software from Apple to GNU as almost no changes should be required. The old API is still supported for backwards compatibility; including the old <code>objc/objc-api.h</code> header file automatically selects the old API, while including the new <code>objc/runtime.h</code> header file automatically selects the new API. Support for the old API is being phased out and upgrading the software to use the new API is strongly recommended. To check for the availability of the new API, the <code>__GNU_LIBOBJC_</code> macro can be used as older versions of the GNU Objective-C runtime library, which do not support the new API, do not define such a macro.</li> <li>Runtime support for <code>@synchronized</code> has been added to the runtime.</li> <li>Runtime support for Objective-C 2.0 synthesized property accessors has been added to the runtime.</li> <li>Runtime support for Objective-C 2.0 fast enumeration has been added to the runtime.</li> </ul>
On Nov 17, 2010, at 9:47 AM, Nicola Pero wrote: > I actually would like to maybe suggest that we put a two line summary on this on the GCC > news front page - mostly to make a statement about FSF GCC's commitment to support Objective-C > going forward. Feel free to write up a short summary and offer it to the web people. I think it's newsworthy. Also, if one goes through all the news bits, there is at times, little there, so having a few more bits, I think in general is a good idea.
On Wed, 17 Nov 2010, Mike Stump wrote: > On Nov 17, 2010, at 9:47 AM, Nicola Pero wrote: >> I actually would like to maybe suggest that we put a two line summary >> on this on the GCC news front page - mostly to make a statement about >> FSF GCC's commitment to support Objective-C going forward. > Feel free to write up a short summary and offer it to the web people. > I think it's newsworthy. Did I miss this, Nicola? That was a bit ago, but I don't think it's too late to add a snippet if you want to propose one. > Also, if one goes through all the news bits, there is at times, little > there, so having a few more bits, I think in general is a good idea. Yes, yes, yes! Gerald
Index: changes.html =================================================================== RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.6/changes.html,v retrieving revision 1.58 diff -u -r1.58 changes.html --- changes.html 7 Nov 2010 13:48:21 -0000 1.58 +++ changes.html 17 Nov 2010 09:11:46 -0000 @@ -293,6 +293,125 @@ <h3>Java (GCJ)</h3> +<h3 id="objective-c">Objective-C and Objective-C++</h3> + + <ul> + <li>The <code>-fobjc-excceptions</code> flag is now required to + enable Objective-C exception and synchronization syntax + (introduced by the keywords <code>@try</code>, + <code>@catch</code>, <code>@finally</code> and + <code>@synchronized</code>).</li> + + <li>A number of Objective-C 2.0 features and extensions are now + supported by GCC. These features are enabled by default; you can + disable them by using the new <code>-fobjc-std=objc1</code> + command-line option.</li> + + <li>The Objective-C 2.0 dot-syntax is now supported both in + Objective-C and Objective-C++. The dot-syntax is an alternative + syntax for using getters and setters; <code>object.count</code> is + automatically converted into <code>[object count]</code> or + <code>[object setCount: ...]</code> depending on context; for + example <code>if (object.count > 0)</code> is automatically + compiled into the equivalent of <code>if ([object count] > + 0)</code> while <code>object.count = 0;</code> is automatically + compiled into the equivalent ot <code>[object setCount: + 0];</code>. The dot-syntax can be used with instance and class + objects and with any setters or getters, no matter if they are + part of a declared property or not.</li> + + <li>Objective-C 2.0 declared properties are now supported both in + Objective-C and Objective-C++. Declared properties are declared + using the new <code>@property</code> keyword, and are most + commonly used in conjunction with the new Objective-C 2.0 + dot-syntax. The <code>nonatomic</code>, <code>readonly</code>, + <code>readwrite</code>, <code>assign</code>, <code>retain</code>, + <code>copy</code>, <code>setter</code> and <code>getter</code> + attributes are all supported. Marking declared properties with + <code>__attribute__ ((deprecated))</code> is supported too.</li> + + <li>The Objective-C 2.0 <code>@synthesize</code> and + <code>@dynamic</code> keywords are supported both in Objective-C + and Objective-C++. <code>@synthesize</code> causes the compiler + to automatically synthesize a declared property, while + <code>@dynamic</code> is used to disable all warnings for a + declared property for which no implementation is provided at + compile time. Synthesizing declared properties requires runtime + support in most useful cases; to be able to use it with the GNU + runtime, appropriate helper functions have been added to the GNU + Objective-C runtime ABI, and are implemented by the GNU + Objective-C runtime library shipped with GCC.</li> + + <li>The Objective-C 2.0 fast enumeration syntax is supported in + Objective-C. This is currently not yet available in + Objective-C++. Fast enumeration requires support in the runtime, + and such support has been added to the GNU Objective-C runtime + library (shipped with GCC).</li> + + <li>The Objective-C 2.0 <code>@optional</code> keyword is + supported in Objective-C and Objective-C++. This keyword allows + you to mark methods or properties in a protocol as optional as + opposed to required.</li> + + <li>The Objective-C 2.0 <code>@package</code> keyword is + supported in Objective-C and Objective-C++. This keyword has + currently the same effect as the <code>@public</code> + keyword.</li> + + <li>Objective-C 2.0 method attributes are supported both in + Objective-C and Objective-C++. Currently the supported attributes + are <code>deprecated</code>, <code>sentinel</code>, + <code>noreturn</code> and <code>format</code>.</li> + + <li>Objective-C 2.0 method argument attributes are supported + both in Objective-C and Objective-C++. The most widely used + attribute is <code>unused</code>, to mark an argument as unused in + the implementation.</li> + + <li>Objective-C 2.0 class and protocol attributes are parsed both + in Objective-C and Objective-C++, but are ignored.</li> + </ul> + + <h4>Runtime Library (libobjc)</h4> + + <ul> + <li>The GNU Objective-C runtime library now defines the macro + <code>__GNU_LIBOBJC__</code> (with a value that is increased at + every release where there is any change to the API) in + <code>objc/objc.h</code> making it easy to determine if the GNU + Objective-C runtime library is being used, and if so, which + version. Previous versions of the GNU Objective-C library (and + other Objective-C runtime libraries such as the Apple one) do not + define this macro.</li> + + <li>A new Objective-C 2.0 API, almost identical to the one + implemented by the Apple Objective-C runtime, has been implemented + in the GNU Objective-C runtime library. The new API hides the + internals of most runtime structures but provides a more extensive + set of functions to operate on them. It is much easier, for + example, to create or modify classes at runtime. The new API also + makes it easier to port software from Apple to GNU as almost no + changes should be required. The old API is still supported for + backwards compatibility; including the old + <code>objc/objc-api.h</code> header file automatically selects the + old API, while including the new <code>objc/runtime.h</code> + header file automatically selects the new API. Support for the + old API is being phased out and upgrading the software to use the + new API is strongly recommended. To check for the availability of + the new API, the <code>__GNU_LIBOBJC_</code> macro can be used as + older versions of the GNU Objective-C library, which do not + support the new API, do not define such a macro.</li> + + <li>Runtime support for <code>@synchronized</code> has been added + to the runtime.</li> + + <li>Runtime support for Objective-C 2.0 synthesized property + accessors has been added to the runtime.</li> + + <li>Runtime support for Objective-C 2.0 fast enumeration has been + added to the runtime.</li> + </ul> + <h2 id="targets">New Targets and Target Specific Improvements</h2> <h3>IA-32/x86-64</h3>