-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ARC #1
base: master
Are you sure you want to change the base?
Support ARC #1
Conversation
My mistake, for some reason I didn't pick that up previously. I've sorted that out, and used the compiler recommendation for %u in the format string. |
I added -fobjc-arc in the Makefile and got this: make test %~/Projects/@reusable/iso-8601-date-formatter-mbaltaks(0) /usr/bin/clang -std=c99 -fobjc-arc -g -Werror -Wmissing-field-initializers -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-variable -Wunused-value -Wshadow -Wsign-compare -Wnewline-eof -Wshorten-64-to-32 -Wundeclared-selector -Wmissing-prototypes -Wformat -Wunknown-pragmas -c -o testparser.o testparser.m testparser.m:5:2: error: 'NSAutoreleasePool' is unavailable: not available in automatic reference counting mode NSAutoreleasePool *pool = [NSAutoreleasePool new]; ^ /System/Library/Frameworks/Foundation.framework/Headers/NSAutoreleasePool.h:8:12: note: declaration has been explicitly marked unavailable here @interface NSAutoreleasePool : NSObject { ^ testparser.m:5:29: error: 'NSAutoreleasePool' is unavailable: not available in automatic reference counting mode NSAutoreleasePool *pool = [NSAutoreleasePool new]; ^ /System/Library/Frameworks/Foundation.framework/Headers/NSAutoreleasePool.h:8:12: note: declaration has been explicitly marked unavailable here @interface NSAutoreleasePool : NSObject { ^ testparser.m:15:37: error: 'autorelease' is unavailable: not available in automatic reference counting mode ISO8601DateFormatter *formatter = [[[ISO8601DateFormatter alloc] init] ... ^ /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:37:1: note: declaration has been explicitly marked unavailable here - (id)autorelease NS_AUTOMATED_REFCOUNT_UNAVAILABLE; ^ testparser.m:15:37: error: ARC forbids explicit message send of 'autorelease' ...*formatter = [[[ISO8601DateFormatter alloc] init] autorelease]; ^ ~~~~~~~~~~~ testparser.m:25:3: error: 'release' is unavailable: not available in automatic reference counting mode [pool release]; ^ /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:36:1: note: declaration has been explicitly marked unavailable here - (oneway void)release NS_AUTOMATED_REFCOUNT_UNAVAILABLE; ^ testparser.m:25:3: error: ARC forbids explicit message send of 'release' [pool release]; ^ ~~~~~~~ 6 errors generated. make: *** [testparser.o] Error 1 Similar errors result in all of the other test-program files, which have not been ARCified or dual-moded. (Ideally, all of the files should be dual-mode, so that the parser and unparser can be regularly tested in either mode.) |
Ok, I've not looked into running with and without ARC automatically, but if you manually add the compiler flag it all seems to look just as it does without the flag. The test output is quite verbose though, and there is no output from the time trial so I may be misunderstanding something there. |
Can we not just drop non-ARC support in the next version instead of doing this conditional compilation hackery? |
What's the state on this? |
The state is:
If anybody wants to help ARC happen in this project sooner, the best way is to contribute test cases. Coveralls will tell you what's currently not tested; here's the main source file as of the current latest build for anyone who's interested. I should note that there are some test cases that have been removed because they fail, and some ported test-monster cases that fail. IIRC, I stubbed these out because they couldn't be fixed without the sort of major refactoring that I'm leaving until I have more test cases. You're welcome to write test cases that fail. If they can't be fixed without major refactoring, I'll keep them on a separate branch. |
I have not done extensive testing, but this patch does seem to work under ARC in my current project, for what testing I've done.