Note that there are some explanatory texts on larger screens.

plurals
  1. POErrors in QT headers using clang
    primarykey
    data
    text
    <h1>Questions:</h1> <hr> <p>My question is thus: How do I build my QT project without turning off warnings altogether (or having to sort through a million purposeless ones to find my own)? Can I suppress warnings for just the QT headers?</p> <h1>Details:</h1> <hr> <h3>Issue</h3> <hr> <p>A number of months ago, I started a QT project in QT-Creator. At the time I was using gcc 4.6. After a bit other priorities asserted themselves and I found myself without time to work on the project until now. In the interim I switched to using clang. When I configured my QT project to use clang -- which project compiled without warnings in g++ -- it generated some 263 warnings all within the QT headers themselves. Mostly sign-conversion and unreachable-code.</p> <hr> <h3>Attempts</h3> <hr> <p>To try and get around this I added -isystem /path/to/QT/include/dir based on <a href="http://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-in-system-headers">this entry in the Clang User Manual</a>, but it did not seem to affect anything. Though I am not certain, I think it is because my code <code>#include</code>'s the QT headers by name, not by directory. While the solution to that might be to manually list every single QT header used (have not tried), it would mean I would have to update it every time I upgraded QT or used a new header. Surely there is a better solution.</p> <p>As requested here is the actual compile command being executed:</p> <pre><code>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 </code></pre> <hr> <h3>Specs</h3> <hr> <p>I am using:</p> <ul> <li>Linux 3.2.0-40-generic #64-Ubuntu SMP x86_64 GNU/Linux <ul> <li>Though others on my team use Windows</li> </ul></li> <li>QT creator 2.6.2 </li> <li>QT 4.8.3</li> <li>clang version 3.2 (trunk 165250) (llvm/trunk 165249) <ul> <li>Target: x86_64-unknown-linux-gnu</li> </ul></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload