Menu

AdditionalIncludeDirectories quots are not removed

2025-03-25
3 days ago
  • Florian Holzmann

    When using visual studio projects the quotes are not removed before the path is resolved, which leads to wrong include pathes

    Example AdditionalIncludeDirectories section from vcxprj

    <AdditionalIncludeDirectories>&quot;..\..\..\3rdparty\Qt\include\QtCore&quot;;&quot;..\..\..\3rdparty\Qt\include\QtNetwork&quot;;&quot;..\..\..\3rdparty\Qt\include\QtGui&quot;;&quot;..\..\..\3rdparty\Qt\include\QtOpenGL&quot;;&quot;..\..\..\3rdparty\Qt\include\QtXml&quot;;&quot;..\..\..\3rdparty\Qt\include\QtSql&quot;;&quot;..\..\..\3rdparty\Qt\include&quot;;&quot;D:\source\12.0\version\.temp\vc143-64\PARTproject.pro\moc&quot;;&quot;..\..\..\3rdparty\subversion\subversion-1.14.2\PSOL\version\vc143-64\rel\include&quot;;&quot;..\..\..\3rdparty\apr\include&quot;;&quot;..\..\..\3rdparty\apr_util\include&quot;;&quot;..\..\..\3rdparty\boost&quot;;&quot;..\..\..\version\.temp\vc143-64\pproject\uic&quot;;&quot;..\..\..\version\.temp\vc143-64\pproject\moc&quot;;&quot;..\..\..\version\.temp\vc143-64\pproject\obj-rel&quot;;&quot;..\..\..\version\.temp\vc143-64\pproject\rcc&quot;;&quot;..\..\..\3rdparty&quot;;&quot;..\..\..\3rdparty\log4cxx\src\main\include&quot;;&quot;..\..\..\libs&quot;;&quot;..\..\..\libs\zApp&quot;;&quot;.&quot;;&quot;..\..\..\3rdparty\Qt\include\ActiveQt&quot;;&quot;..\..\..\version\.temp\vc143-64\pproject\uic&quot;;..\..\..\build\psol\mkspecs\win32-msvc2022-64;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
          <AdditionalOptions>/FS /bigobj /std:c++20 /permissive /Zc:rvalueCast /Zc:ternary /Zc:char8_t /Zc:hiddenFriend /Zc:lambda /Zc:__cplusplus /Zc:referenceBinding -w34265 -w34589 -w34702 -w34456 %(AdditionalOptions)</AdditionalOptions>
    

    Hacky fix:

    diff -r C:\bla\cppcheck-2.16.0\lib\importproject.cpp C:\bla\cppcheck-2.16.0_orig\lib\importproject.cpp
    151c151
    <     for (std::string ipath : copyIn) {
    ---
    >     for (const std::string &ipath : copyIn) {
    157,158d155
    <         if (startsWith(ipath, "\""))
    <           ipath = ipath.erase(0, 1);
    160,161d155
    <         if (endsWith(ipath, "\""))
    <           ipath = ipath.erase(ipath.size()-1, 1);
    
     
  • Daniel Marjamäki

    Thanks for reporting this issue. I have created this ticket:
    https://trac.cppcheck.net/ticket/13963

     

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.