johnthagen/clion-cppcheck

Crash due to unhandled ExecutionException with cppcheck installed with snap in ubuntu 20.04

开放

#39 创建于 2020年6月14日

 (5 条评论) (0 个反应) (0 位负责人)Java (7 个派生)github user discovery
bughelp wanted

仓库指标

星标
 (37 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Environment

  • Operating System : Ubuntu 20.04 LTS
  • IDE Version : CLion 2020.1.2
  • Cppcheck executable version : 2.0
  • Cppcheck plugin version : 1.4.2
  • Exact strings used in cppcheck plugin options:
    • cppcheck path: /snap/bin/cppcheck
    • cppcheck options: --enable=warning,performance,portability,style --language=c++

Expected behaviour

I expect the found errors being highlighted in clion for this main.cpp:

int main() {
    char *p; //(style) unassignedVariable: Variable 'p' is not assigned a value.
    *p = 0; // (error) uninitvar: Uninitialized variable: p
}

Just like when I run it from the terminal:

/snap/bin/cppcheck "--template=[{file}:{line}]: ({severity}) {id}: {message}" -I/home/anders/CLionProjects/untitled --enable=warning,performance,portability,style --language=c++ /home/anders/CLionProjects/untitled/main.cpp
Checking /home/anders/CLionProjects/untitled/main.cpp ...
[/home/anders/CLionProjects/untitled/main.cpp:5]: (error) uninitvar: Uninitialized variable: p
[/home/anders/CLionProjects/untitled/main.cpp:4]: (style) unassignedVariable: Variable 'p' is not assigned a value.

Actual behaviour

No inspection warnings/errors are shown, but this is in the event log:

11:22 AM	Error: ExecutionException: Cppcheck Error : Exit Code - 1 : /snap/bin/cppcheck "--template=[{file}:{line}]: ({severity}) {id}: {message}" -I/home/anders/CLionProjects/untitled --enable=warning,performance,portability,style --language=c++ /tmp/___main.cpp

Steps to reproduce the behaviour

  • Install cppcheck with software center https://snapcraft.io/cppcheck
  • Install cppcheck plugin and update to version 1.4.2
  • Make a new project.
  • Insert code from above in main.
  • Watch event log for error message.

Possible workaround

  • Install cppcheck with apt-get and use /usr/bin/cppcheck as path

贡献者指南