Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-16526

Clang Static Analyzer fails when using MSVC2013

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P1: Critical
    • None
    • Qt Creator 4.1.0-beta1
    • Windows 7 64 bit
      MSVC2013 32 bit

    Description

      1. Open a project with this trivial main file:
        #include <cfloat>
        
        int main(int argc, char *argv[])
        {
        }
        
      2. Configure the project to use MSVC2013.
      3. Run the Clang Static Analyzer.
        It will finish with an error:
        :-1: warning: Clang Static Analyzer finished with exit code: 1.
        
        :-1: warning: Command line: "C:/Qt-06.30o/qtcreator-4.1.0-beta1/bin/clang-cl.exe" "--analyze" "-o" "C:/Users/rob/AppData/Local/Temp/qtc-clangstaticanalyzer-ReWiJ1/report-main.cpp-Eq5784.plist" "-m32" "/TP" "/EHsc" "/D__MSVCRT__=" "/D__w64=" "/D__int64=long long" "/D__int32=long" "/D__int16=short" "/D__int8=char" "/D__ptr32=" "/D__ptr64=" "/D__COUNTER__=" "/D_CPPRTTI=" "/D_CPPUNWIND=" "/D_DEBUG=" "/D_DLL=" "/D__FUNCDNAME__= __FUNCDNAME__ " "/D__FUNCSIG__= __FUNCSIG__ " "/D__FUNCTION__= __FUNCTION__ " "/D_INTEGRAL_MAX_BITS=6" "/D_M_IX86=60" "/D_M_IX86_FP=" "/D_MSC_BUILD=" "/D_MSC_EXTENSIONS=" "/D_MSC_FULL_VER=18003110" "/D_MSC_VER=180" "/D_MT=" "/D_NATIVE_WCHAR_T_DEFINED=" "/D_WCHAR_T_DEFINED=" "/D_WIN32=" "/D__DATE__="Jun 30 2016" "/D__TIME__="11:11:30" "/D__TIMESTAMP__="Thu Jun 30 11:11:30 2016" "/DUNICODE=1" "/DWIN32=1" "/DQT_QML_DEBUG=1" "/DQT_CORE_LIB=1" "/IC:/Users/rob/dev/src/creator-4.1-enterprise/qtcreator/tests/manual/debugger/cli-io" "/ID:/dev/32/MSVC2013/qt-5.7.0-desktop/qtbase/include" "/ID:/dev/32/MSVC2013/qt-5.7.0-desktop/qtbase/include/QtCore" "/IC:/Users/rob/dev/src/creator-4.1-enterprise/qtcreator/tests/manual/debugger/build-cli-io-Desktop-Debug" "/ID:/dev/src/qt-5.7.0/qtbase/mkspecs/win32-msvc2013" "/IC:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE" "/IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "/IC:\Program Files (x86)\Windows Kits\8.1\include\um" "/IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" "/IC:\Program Files (x86)\icu\include" "/IC:\OpenSSL-Win32\include" "-fms-compatibility-version=18.00" "C:\Users\rob\dev\src\creator-4.1-enterprise\qtcreator\tests\manual\debugger\cli-io\main.cpp"
        Process Error: 5
        Output:
        In file included from C:\Users\rob\dev\src\creator-4.1-enterprise\qtcreator\tests\manual\debugger\cli-io\main.cpp:1:
        In file included from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\cfloat:7:
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\float.h(63,16) :  error: invalid token at start of a preprocessor expression
        #if _M_IX86_FP == 2
                       ^
        1 error generated.
        
        :-1: error: Clang Static Analyzer: Not all files could be analyzed.
        

        This seems to make it impossible to analyze any Qt project because <QCoreApplication> includes <cfloat>.

      It should be possible to analyze Qt projects with the ClangStaticAnalyzer plugin.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kosjar Nikolai Kosjar
              rlohning Robert Löhning
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes