We use VS 2008 Professional and the Qt Visual Studio Add-In to develop a Qt 4.8.4 application. I would like to set the warning level to 4 (all warnings), but for our own code only. If I set a warning level >= 2 under project properties, I get several hundred warnings from Qt header files we #include
.
Unfortunately, it seems VS does not have an equivalent of gcc's -isystem option. I have tried enclosing Qt #include
s between #pragma warning(push, 0)
and #pragma warning(pop)
with limited success. Auto-generated moc_*.cpp files still cause warnings about code in Qt header files. It is also quite cumbersome.
Do you know of any other way to achieve this? I'm finding it hard to believe all Qt/MSVC users have their warnings muted or skim through hundreds of irrelevant warnings after building.
We wrap our #include blocks in pragmas to disable warnings. Other than that we can only hope MS will implement isystem one day. https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/14717934-add-a-cl-exe-option-for-system-headers-like-gcc-s
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With