QCAD

QCAD - 2D CAD System.

Click here for a documentation of the DokuWiki formatting syntax that can be used in reports

Please search for existing tasks (also closed ones) before opening a new task.

Please make sure that you are using the latest Version of QCAD before posting a bug (menu Help - Check for Updates)

Tasklist

FS#885 - Xcode Clang wrongly reported as GCC

Attached to Project: QCAD
Opened by Tamas TEVESZ (kazmer) - Wednesday, 14 August 2013, 21:58 GMT+1
Last edited by Andrew (andrew) - Thursday, 15 August 2013, 01:59 GMT+1
Task Type Bug Report
Category Main
Status Closed
Assigned To Andrew (andrew)
Operating System Mac OS X (All)
Severity Low
Priority Normal
Reported Version 3.2.0
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

src/core/RSettings.cpp:RSettings::getCompilerVersion() doesn’t account for Clang, used in Xcode. Instead of reporting the appropriate Clang version number, it reports the GCC compatibility level. The following patch addresses the issue.

diff --git a/src/core/RSettings.cpp b/src/core/RSettings.cpp
index 46dc6df..d6fbe63 100644
--- a/src/core/RSettings.cpp
+++ b/src/core/RSettings.cpp
@@ -363,7 +363,9 @@ QString RSettings::getQtVersion() {
 }
 
 QString RSettings::getCompilerVersion() {
-#if defined(Q_CC_GNU)
+#if defined(Q_CC_CLANG)
+    return QString("Clang %1.%2.%3").arg(__clang_major__).arg(__clang_minor__).arg(__clang_patchlevel__);
+#elif defined(Q_CC_GNU)
     return QString("gcc %1.%2.%3").arg(__GNUC__).arg(__GNUC_MINOR__).arg(__GNUC_PATCHLEVEL__);
 #elif defined(Q_CC_MSVC)
 #   if _MSC_VER==1310
This task depends upon

Closed by  Andrew (andrew)
Thursday, 15 August 2013, 01:59 GMT+1
Reason for closing:  Fixed
Additional comments about closing:  https://github.com/qcad/qcad/commit/328f eb6eb3c6ee165d027c73d5f6a422644649c8
Comment by Andrew (andrew) - Thursday, 15 August 2013, 01:58 GMT+1

Excellent, thanks for the patch!

Loading...