Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Qt warnings in Visual Studio 2008

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 #includes 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.

like image 749
Joseph Schröer Avatar asked Nov 13 '22 04:11

Joseph Schröer


1 Answers

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

like image 144
Trass3r Avatar answered Nov 14 '22 23:11

Trass3r