I was reading the clang documentation on reference counting, which says that “ By default in Objective-C, ARC is not exception-safe”. It proceeds to say:
A program may be compiled with the option
-fobjc-arc-exceptions
in order to enable these, or with the option-fno-objc-arc-exceptions
to explicitly disable them, with the last such argument “winning”. In Objective-C++,-fobjc-arc-exceptions
is enabled by default.
I was intrigued. Are there any other compiler options whose default change between Objective-C and Objective-C++?
Complementary question: what is difference between compiling purely Objective-C code with clang in Objective-C++ mode (*.mm
files) rather than in Objective-C mode only (*.m
)?
Best way is to log what clang will output from all those c language
here's some of what i have got from a obj-c++ compilation
clang++ -fobjc-arc main.mm -v
/.../
-fblocks
-fobjc-runtime=macosx-10.7.0
-fobjc-dispatch-method=mixed
-fobjc-default-synthesize-properties
-fobjc-arc
-fobjc-arc-cxxlib=libstdc++
-fobjc-arc-exceptions
-fobjc-exceptions
-fcxx-exceptions
-fexceptions
-fdiagnostics-show-option
-fcolor-diagnostics
/.../
As you can see those output can vary depending from where you compile it. But some of them are constants.
You should try on different c families files in order to determine what the default option are for these respective.
Hope it will help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With