http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47012

           Summary: nonatimic Properties behave wrong
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libobjc
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: js-...@webkeks.org


It seems nonatomic properties retain and autorelease the result, which is
breaking existing code targeting the Apple runtime.

This bug has been also in the GNUstep runtime and the Cocotron runtime, it
seems this bug has been copied to the new GNU runtime now.

The Apple doc says:
"If you specify nonatomic, then a synthesized accessor for an object property
simply returns the value directly."
<http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocProperties.html>

I have written a property implementation which is known to be compatible to the
Apple runtime which is quite short and I'd like to contribute. It is currently
licensed under the QPL, but I plan to relicense it as GPL if you are
interested.

If you need a testcase, there is a test for properties included in ObjFW
<https://webkeks.org/hg/objfw>, in src/PropertiesTests.m, which also fails. It
works well with the Apple runtime and the included properties implementation in
src/objc-properties.m - this is also the implementation I'd like to contribute.
Let me know if you are interested.

Direct links:
Runtime I'd like to contribute:
<https://webkeks.org/hg/objfw/file/tip/src/objc_properties.m> (Will relicense
if there's interest!)
Tests that fail:
<https://webkeks.org/hg/objfw/file/tip/tests/PropertiesTests.m>

Reply via email to