Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

Static Code Analysis ends in compiler error with C2171 when including Qt headers. How to suppress?

$
0
0

First: If this is the wrong forum, please move. The only relevant static code analysis forum I found was in the archived section.

In VS 2012 we are experiencing compiler errors when analyzing code that contains Qt.

Simply including

#include "QtGui\QtGui"

compiles fine, but if we use the static code analysis, then we suddenly get compiler(!) errors like:

Error    1    error C2171: '!' : illegal on operands of type ''unknown-type''    d:\local3rdpartyrepository\qt\5.2.1\win32\vs2012\include\qtcore\qarraydataops.h    399

There are several users with this issue:

SO Thread
Qt 1
Qt 2

But no proper solution to this.

Using #pragma warning disable, e.g:

#include <codeanalysis\warnings.h>#pragma warningpush )#pragma warning ( disable : ALL_CODE_ANALYSIS_WARNINGS )#include "QtGui\QtGui"#pragma warningpop )

Does not work as this affects code violations but not compiler errors.

Trying /analyze:only did not work either. How is this suppose to work? Does the static code analyzer use a different toolchain for parsing c++ code and cannot handle the meta-programming during analysis?


Regards




Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>