Shouldn't need to specify -fobjc-exceptions when building FileChangeWatcher.m

Status

Camino Graveyard
General
11 years ago
8 years ago

People

(Reporter: Mark Mentovai, Assigned: Smokey Ardisson (offline for a while; not following bugs - do not email))

Tracking

Details

(URL)

(Reporter)

Description

11 years ago
When we compile FileChangeWatcher.m, we explicitly specify -fobjc-exceptions for the file via COMPILER_FLAGS.  We don't use -fobjc-exceptions during any other part of the build.  This flag is only documented for gcc 3.3, and even with that compiler, Objective-C exceptions are enabled automatically when the deployment target is 10.3 or higher.  On the trunk and branch, we always have the deployment target set to 10.3 or higher.

We use Objective-C @try/@catch exceptions in other source files, such as MainController.mm, without specifying -fobjc-exceptions.  We should drop -fobjc-exceptions from FileChangeWatcher.m, too.  If we still do have a reason to keep it on, we should set it for the rest of the application, so that the other files that use Objective-C exceptions are built in the same way.

You can find per-file build settings by looking for "settings =" in the project file (note lowercase s).  In addition to FileChangeWatcher.m:

 - KeychainService.mm uses -DNO_NSPR_10_SUPPORT - is this needed?
 - main.m in CaminoApp (but not CaminoStaticApp) has a settings section with
   an empty ATTRIBUTES list, we can get rid of the settings section entirely.
(Reporter)

Comment 1

11 years ago
In the case of KeychainService.mm, -DNO_NSPR_10_SUPPORT avoids a compiler error due to duplicate definitions of uint32.  We should see if we can build the entire application with -DNO_NSPR_10_SUPPORT, avoiding the need to set it on a per-file basis.
(Reporter)

Updated

11 years ago
Summary: Shouldn't need to specify -fobjc-exceptions FileChangeWatcher.m → Shouldn't need to specify -fobjc-exceptions when building FileChangeWatcher.m
(Reporter)

Comment 2

11 years ago
I can confirm that exception support is properly enabled by gcc 3.3 and 4.0 when the deployment target is set to 10.3 or higher.  The compiler will correctly complain when the deployment target is set lower and exceptions (or @synchronized) are used without -fobjc-exceptions, and will also complain if the deployment target is set lower and -fobjc-exceptions is specified, because exception support can't be guaranteed in the deployment runtime.  We should experience no problems by dropping -fobjc-exceptions from FileChangeWatcher.m's per-target COMPILER_FLAGS.
Not sure why this was set to 1.8; all of the problems exist on the trunk as well, and -DNO_NSPR_10_SUPPORT has expanded to KeychainAutoCompleteSession.mm.

Things to do here:

* We should see if we can build the entire application with 
  -DNO_NSPR_10_SUPPORT, avoiding the need to set it on a per-file 
  (KeychainAutoCompleteSession.mm, KeychainService.mm) basis.

* Remove the settings section from main.m in CaminoApp

* Remove the settings section (-fobjc-exceptions) from FileChangeWatcher.m
Version: 1.8 Branch → unspecified
Taking, so that this stays on my radar for when I have no pending or conflicting build system changes.
Assignee: nobody → alqahira
You need to log in before you can comment on or make changes to this bug.