Set QT_NO_EXCEPTIONS for *.mm files
Review Request #130139 - Created May 25, 2017 and discarded
Seems that some versions of clang default to build *.mm files with exceptions disabled, so compilation would fail with: include/QtCore/qlist.h:522:9: error: cannot use 'throw' with exceptions disabled
|I think you'll need to investigate this issue further first. I've been building (and patching) KInit since 5.16.0 or so ...||René J.V. Bertin|
I think you'll need to investigate this issue further first. I've been building (and patching) KInit since 5.16.0 or so and never run into this issue (neither have the other testers of my to-be-official MacPorts ports).
I just checked (with AppleClang and macports-clang-4.0): all of KInit is built with
-fno-exceptions, which has been the default for quite a while now (see KDECompilerSettings in the ECM). Yet for me QT_NO_EXCEPTIONS is NOT defined when I build kinit_mac.mm (nor when I include qlist.h and presumably not in the other files either).
Which raises a number of questions:
1. why is QT_NO_EXCEPTIONS not required on my end, but it is on your end (or with HomeBrew's build recipes)?
2. is this related to how Qt is built?
3. why is only kinit_mac.mm concerned, or more generally, why would this be an ObjC++ issue?
Either way, the real issue here lies in KDE's disabling of exceptions, and Qt's lacking magic in qglobal.h (around line 632 in Qt 5.8.0) that defines QT_NO_EXCEPTIONS as needed when GCC is being used. I haven't verified it that test can be extended to clang too (it works with GCC on Mac) but it seems much more reasonable to define QT_NO_EXCEPTIONS in the ECM than as suggested here on a case-by-case basis.
-2 as is thus, as far as I'm concerned.