Skip to content

Cppcheck stops working correctly after setting "Wrap commands executed with cmd.exe" once on #668

@timosperisen

Description

@timosperisen

Configuration:

Windows 7, 64 Bit
Codelite 7.0 , 64 Bit (installer codelite-amd64-7.0.exe )
 install-dir: c:\CodeLite

PATH-variable contains c:\CodeLite
Environment variables inside CodeLite : CodeLiteDir=c:\CodeLite

Issue:

After setting true the following setting...
Settings > Global Editor Preferences > Terminal > Windows only: commands executed with CMD.EXE are wrapped with double quotes and trying to run cppcheck via context-menu on the project the error that gets produced inside the CppCheck-Tab looks similar to this:

Starting cppcheck: C:\CodeLite\codelite_cppcheck.exe  --enable=style  --enable=performance  --enable=portability  --enable=unusedFunction  --enable=missingInclude  --enable=information  --std=posix  --std=c99  --std=c++11 --force  --template gcc  --file-list="C:\cpp_projects\testproject\.codelite\cppcheck.list"
:: information: Failed to load std.cfg. Your Cppcheck installation is broken, please re-install. The Cppcheck binary was compiled with CFGDIR set to "config/cppcheck" and will therefore search for std.cfg in that path.
===== cppcheck analysis ended. Found 0 possible errors=====

When I copy the command

C:\CodeLite\codelite_cppcheck.exe  --enable=style  --enable=performance  --enable=portability  --enable=unusedFunction  --enable=missingInclude  --enable=information  --std=posix  --std=c99  --std=c++11 --force  --template gcc  --file-list="C:\cpp_projects\testproject\.codelite\cppcheck.list"

from the CppCheck-Tab and run it in a Command-Shell I get a similar error:

C:\>C:\CodeLite\codelite_cppcheck.exe  --enable=style  --enable=performance  --enable=portability  --enable=unusedFuncti
on  --enable=missingInclude  --enable=information  --std=posix  --std=c99  --std=c++11 --force  -IC:\dev_libs_cpp\SFML-2
.2\include -IC:\cpp_projects\testproject\src --template gcc  -I\cpp_projects\testproject\ -I\dev_libs_cpp\SFML-2.2\inclu
de\ --file-list="C:\cpp_projects\testproject\.codelite\cppcheck.list"
:: information: Failed to load std.cfg. Your Cppcheck installation is broken, please re-install. The Cppcheck binary was
 compiled with CFGDIR set to "config/cppcheck" and will therefore search for std.cfg in that path.
C:\>

When I cd to C:\CodeLite to run the same command again it works.

After changing the option back to false in the settings the behaviour does not change at all.

I suspect that the "wrap CMD.EXE" - setting does not get set back to false in the configuration after changing it back but maybe that guess is wrong. Unfortunately I was not able to find the location where the setting is written. I checked codelite.xml and codelite.conf (and the other configuration files inside the C:\Users\[USERNAME]\AppData\Roaming\codelite settings folder) . I also tried to find out what files are accessed it by using procmon and by scanning the registry. In the source code I found some clues about the setting itself. But it seems it is based on auto-generated code for wxWidgets.

Is this setting somehow saved inside the workspace or even in the project? After doing a clean install ( while removing user settings ) the behaviour still persists.

PS:
The reason for trying to use the "wrapping option" in the first place is that the standard installation path contains spaces ( C:\Program Files\CodeLite ) ... I reinstalled CodeLite several times and ended up changing it to c:\CodeLite .. which did not solve the problems inside CodeLite.

Thanks for any help on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions