iphone - Combining ARC and non-ARC files not working -
once add -fno-objc-arc flag 1 or more individual files in build phases, myproject-prefix.pch file thrown non-arc mode, causing 150 warnings "warning: no 'assign', 'retain', or 'copy' attribute specified - 'assign' assumed" thrown.
here's clang log output compiling myproject-prefix.pch. can see, -fobjc-arc flag appears, later on, -no-fobjc-arc added, i'm assuming overrides arc. happens if add -fno-objc-arc single .m source file in build phases (the standard advice gets mix arc , non-arc files).
any ideas?
/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -x objective-c-header -arch i386 -fmessage-length=0 -std=gnu99 -fobjc-arc -wno-trigraphs -fpascal-strings -o0 -wno-missing-field-initializers -wno-missing-prototypes -wreturn-type -wno-implicit-atomic-properties -wformat -wno-missing-braces -wparentheses -wswitch -wno-unused-function -wno-unused-label -wno-unused-parameter -wunused-variable -wunused-value -wno-uninitialized -wno-unknown-pragmas -wno-shadow -wno-four-char-constants -wno-sign-compare -wno-shorten-64-to-32 -wpointer-sign -wno-newline-eof -wno-selector -wno-strict-selector-match -wno-undeclared-selector -wno-deprecated-implementations -ddebug -isysroot /applications/xcode.app/contents/developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulator5.1.sdk -fexceptions -fasm-blocks -wprotocol -wdeprecated-declarations -mmacosx-version-min=10.6 -g -wno-conversion -wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch "-diboutlet=__attribute__((iboutlet))" "-diboutletcollection(classname)=__attribute__((iboutletcollection(classname)))" "-dibaction=void)__attribute__((ibaction)" -d__iphone_os_version_min_required=50100 -iquote /users/steve/library/developer/xcode/deriveddata/myproject-ajtusdfivjqtabgvzfuzqifdjuis/build/intermediates/myproject.build/debug-iphonesimulator/myproject.build/myproject-generated-files.hmap -i/users/steve/library/developer/xcode/deriveddata/myproject-ajtusdfivjqtabgvzfuzqifdjuis/build/intermediates/myproject.build/debug-iphonesimulator/myproject.build/myproject-own-target-headers.hmap -i/users/steve/library/developer/xcode/deriveddata/myproject-ajtusdfivjqtabgvzfuzqifdjuis/build/intermediates/myproject.build/debug-iphonesimulator/myproject.build/myproject-all-target-headers.hmap -iquote /users/steve/library/developer/xcode/deriveddata/myproject-ajtusdfivjqtabgvzfuzqifdjuis/build/intermediates/myproject.build/debug-iphonesimulator/myproject.build/myproject-project-headers.hmap -iquoteoauth2client -iquoteoauth2client/sources -iquoteoauth2client/sources/oauth2client -i/users/steve/library/developer/xcode/deriveddata/myproject-ajtusdfivjqtabgvzfuzqifdjuis/build/products/debug-iphonesimulator/include -i../../source/facebook-ios-sdk/src -i/users/steve/library/developer/xcode/deriveddata/myproject-ajtusdfivjqtabgvzfuzqifdjuis/build/products/debug-iphonesimulator/../three20 -i/users/steve/library/developer/xcode/deriveddata/myproject-ajtusdfivjqtabgvzfuzqifdjuis/build/products/debug-iphonesimulator/../../three20 -i../../source/three20/build/products/three20 -i/users/steve/library/developer/xcode/deriveddata/myproject-ajtusdfivjqtabgvzfuzqifdjuis/build/intermediates/myproject.build/debug-iphonesimulator/myproject.build/derivedsources/i386 -i/users/steve/library/developer/xcode/deriveddata/myproject-ajtusdfivjqtabgvzfuzqifdjuis/build/intermediates/myproject.build/debug-iphonesimulator/myproject.build/derivedsources -f/users/steve/library/developer/xcode/deriveddata/myproject-ajtusdfivjqtabgvzfuzqifdjuis/build/products/debug-iphonesimulator -f/users/steve/desktop/myproject/yelpapi/frameworks -fno-objc-arc --serialize-diagnostics /users/steve/library/developer/xcode/deriveddata/myproject-ajtusdfivjqtabgvzfuzqifdjuis/build/intermediates/precompiledheaders/myproject-prefix-eouuweehlrhtjxdsrgwseamnhnna/myproject-prefix.pch.dia -c /users/steve/desktop/myproject/myproject/myproject-prefix.pch -o /users/steve/library/developer/xcode/deriveddata/myproject-ajtusdfivjqtabgvzfuzqifdjuis/build/intermediates/precompiledheaders/myproject-prefix-eouuweehlrhtjxdsrgwseamnhnna/myproject-prefix.pch.pth -mmd -mt dependencies -mf /users/steve/library/developer/xcode/deriveddata/myproject-ajtusdfivjqtabgvzfuzqifdjuis/build/intermediates/precompiledheaders/myproject-prefix-eouuweehlrhtjxdsrgwseamnhnna/myproject-prefix.pch.d
this expected. chances high .pch file contains definitions cause warning when compiled in non-arc mode. non-arc compiled files use precompiled header, too, header in .pch files should compilable in both arc , non-arc mode (after all, pch mechanism semantically equivalent putting #imports of .pch file each , every .m file).
i bug of xcode if still gave these warning when non-arc compiled files explicitly exempted pch compilation model. apparently can't turn off usage of pre-compiled headers single files under xcode (as can ms's visualc++), advice can give make classes in .pch file compatible both arc , non-arc compilation.
Comments
Post a Comment