Questions:
My question is this: how do I create my QT project without disabling alerts at all (or do you need to sort a million aimless to find your own)? Can I suppress warnings only for QT headers?
Details:
Question
A few months ago, I started the QT project at QT-Creator. I used gcc 4.6 at the time. After some other priorities were established, and I found myself without time to work on the project so far. In the meantime, I switched to using clang. When I set up my QT project to use clang - which project was compiled without warning in g ++, it generated about 263 warnings in the QT headers themselves. Mostly character conversion and unreachable code.
Attempts
To try to get around this, I added the -system / path / to / QT / include / dir based on this entry in the Clang User Guide , but it doesnβt seem to affect anything. Although I'm not sure, I think this is because my code #include QT headers by name and not by directory. Although the solution for this might be to manually list each individual QT header (not tried), this would mean that I would have to update it every time I updated QT or used a new header. Of course, there is a better solution.
As requested here, an executable compilation command is executed:
clang++ -c -pipe -Qunused-arguments -Weverything -cxx-isystem /path/to/qt/4.8.3/include/ -g -D_REENTRANT -DQT_NO_KEYWORDS -DQT_SHARED -I/path/to/qt/x86_64/4.8.3/mkspecs/unsupported/linux-clang -I. -I.moc -I.ui -I/path/to/qt/4.8.3/include/ -o .obj/main.o main.cpp
the functions
I use:
- Linux 3.2.0-40-generi # 64-Ubuntu SMP x86_64 GNU / Linux
- While others on my team use Windows
- QT 2.6.2 creator
- QT 4.8.3
- clang version 3.2 (trunk 165250) (llvm / trunk 165249)
- Target: x86_64-unknown-linux-gnu
c ++ clang qt4
Tsubashi
source share