Menu

[MSVC][arm64] CppCheck failed due to error C2039 on Windows arm64 building

2024-08-05
2024-08-07
  • Quella Zhang

    Quella Zhang - 2024-08-05

    The MSVC team tried to build cppcheck on Windows arm64 to detect compiler regressions, but it failed with the following error, can you take a look?

    Repro steps:
    1. set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=arm64
    2. git https://github.com/danmar/cppcheck.git C:\gitP\danmar\cppcheck
    3. mkdir C:\gitP\danmar\cppcheck\build_arm64
    4. cd /d C:\gitP\danmar\cppcheck\build_arm64
    5. cmake -G "Visual Studio 17 2022" -A arm64 -DCMAKE_SYSTEM_VERSION=10.0.22621.0 ..
    6. msbuild /m /p:Platform=arm64 /p:Configuration=Release Cppcheck.sln /t:Rebuild

    Error info:
    cppcheckexecutorseh.cpp
    C:\gitP\danmar\cppcheck\cli\cppcheckexecutorseh.cpp(89,42): error C2039: 'Rip': is not a member of '_CONTEXT'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winnt.h(6549,54): note: see declaration of '_CONTEXT'
    C:\gitP\danmar\cppcheck\cli\cppcheckexecutorseh.cpp(91,42): error C2039: 'Rsp': is not a member of '_CONTEXT'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winnt.h(6549,54): note: see declaration of '_CONTEXT'
    C:\gitP\danmar\cppcheck\cli\cppcheckexecutorseh.cpp(93,42): error C2039: 'Rsp': is not a member of '_CONTEXT'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winnt.h(6549,54): note: see declaration of '_CONTEXT'

     
  • CHR

    CHR - 2024-08-05

    I'm afraid we don't test with Windows on ARM. Does the build succeed if cppcheckexecutorseh.cppis modified to use the #ifdef _M_IX86 block instead of the #else block?

     
  • Quella Zhang

    Quella Zhang - 2024-08-07

    It will also fail.

    C:\gitP\danmar\cppcheck\cli\cppcheckexecutorseh.cpp(82,42): error C2039: 'Eip': is not a member of '_CONTEXT'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winnt.h(6549,54): note: see declaration of '_CONTEXT'
    C:\gitP\danmar\cppcheck\cli\cppcheckexecutorseh.cpp(84,42): error C2039: 'Esp': is not a member of '_CONTEXT'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winnt.h(6549,54): note: see declaration of '_CONTEXT'
    C:\gitP\danmar\cppcheck\cli\cppcheckexecutorseh.cpp(86,42): error C2039: 'Ebp': is not a member of '_CONTEXT'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winnt.h(6549,54): note: see declaration of '_CONTEXT

     
  • CHR

    CHR - 2024-08-07

    Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/12991

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.