johnthagen/clion-cppcheck

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

Aperta

#39 aperta il 14 giu 2020

 (5 commenti) (0 reazioni) (0 assegnatari)Java (7 fork)github user discovery
bughelp wanted

Metriche repository

Star
 (37 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor