Qt5/Mac header finding in KDevelop5 (clang parser??)

René J.V. Bertin rjvbertin at gmail.com
Tue Jun 21 12:02:46 UTC 2016


On Tuesday June 21 2016 13:44:29 Milian Wolff wrote:

> ^-- this is unrelated to the code snippet. It looks like an error while 
> parsing parsesession.cpp in the editor, no?

Yes. This whole thread is about parsing in the editor.

> It's not an error inside the 
> wrapped Qt header itself (or I'm not seeing it).

I don't think so, no.

> > /opt/local/include/qt5/QtCore/qcompilerdetection.h:630:38: error: token is
> > not a valid binary operator in a preprocessor subexpression
> 
> ^-- what is the contents of that line?

 623 /* C++11 features, see http://clang.llvm.org/cxx_status.html */
 624 #  if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
 625     /* Detect C++ features using __has_feature(), see http://clang.llvm.org/docs/LanguageExtensions.html#cxx11 */
 626 #    if __has_feature(cxx_alignas)
 627 #      define Q_COMPILER_ALIGNAS
 628 #      define Q_COMPILER_ALIGNOF
 629 #    endif
 630 #    if __has_feature(cxx_atomic) && __has_include(<atomic>)
 631 #     define Q_COMPILER_ATOMICS
 632 #    endif
 633 #    if __has_feature(cxx_attributes)
 634 #      define Q_COMPILER_ATTRIBUTES
 635 #    endif

> ^-- you are using GCC on Mac? Bad idea, better use clang instead to get the 
> system headers and include paths.

No, most certainly not;
> > /usr/lib/gcc/x86_64-linux-gnu/5/include/xmmintrin.h:777:28: error: cannot
                 ^^^^^^^^^^^^^^^^

That whole output snippet was on Linux.

> use clang instead to get the system headers and include paths.

Is that supposed to work? It doesn't for me, at least not for the headers from the system frameworks.

And as a side-note, gcc is most likely capable to find those headers too; it's always been at least. You basically only get compatibility issues with g++, not gcc, because OS X uses libc++ instead of libstdc++. So as long as you manage not to mix libraries that use both runtimes you should be fine. That's enough of a gamble to avoid g++, of course (certain system SDKs are written in C++ or possibly ObjC++).

R


More information about the KDevelop-devel mailing list