[cfe-dev] Clang: QT header compilation error

Dmitri Gribenko gribozavr at gmail.com
Tue Nov 20 23:42:21 PST 2012

On Wed, Nov 21, 2012 at 6:02 AM, Sujit Kamthe
<Sujit.Kamthe at kpitcummins.com> wrote:
> Hi Matthieu, Dmitri,
> Attaching the text file (log.txt) which has the output generated by
> command using –E option.
> After some time clang thrown an exception and stopped working.

Unfortunately, I could not reproduce the crash, but the preprocessed
file you sent confirmed Matthieu's diagnosis.  The file contains:

#  if _MSC_VER < 1310
#     define QT_NO_QOBJECT_CHECK
#     define Q_TYPENAME

And Clang defines _MSC_VER to 1300.  But in my opinion this code path
should not be executed for Clang because Qt 4.7.4 has support for
Clang, one should just select appropriate compiler configuration
(during Qt compilation?).

There's also a bug in our crash report generation.  Note the
mismatched quotes and the inappropriate "Files\\..." part in:

-cc1 -triple i686-pc-win32 -E -disable-free -disable-llvm-verifier
-main-file-name XvvHmiLogic.cpp -mrelocation-model static
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-target-cpu pentium4 -momit-leaf-frame-pointer Files\\Microsoft Visual
Studio 9.0\\VC\\include" Files\\Microsoft
SDKs\\Windows\\v6.0A\\\\include" -std=c++11 -fdeprecated-macro
-ferror-limit 19 -fmessage-length 80 -mstackrealign -fms-extensions
-fms-compatibility -fmsc-version=1300 -fdelayed-template-parsing
-fobjc-runtime=gcc -fobjc-default-synthesize-properties
-fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -x c++ XvvHmiLogic-246825.cpp


(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/

More information about the cfe-dev mailing list