Skip to content

emacs 30.2 and ts modes - flymake-cppcheck not working #5

@rileyrg

Description

@rileyrg

GNU Emacs 30.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.50, cairo version 1.18.4)

Hi, I checked cppcheck works from the command line. flymake-cppcheck isnt working inside my cpp files though. Is there anything obvious I may have missed? the load function is defintiely called. flymake-easy is also loaded.

(use-package flymake-cppcheck
    :ensure (:host github :repo "https://github.com/flymake/flymake-cppcheck")
    :custom
    (flymake-cppcheck-enable "warning,performance,information,style")
    :hook
      ((c-ts-mode c++-ts-mode) . flymake-cppcheck-load))

Seeing nothing in my flymake enabled main.cpp buffer - but quick command line check shows cppcheck to be working fine:

➜ ScratchPad git:(main) ✗ cppcheck --enable="warning,performance,information,style" main.cpp
Checking main.cpp ...
main.cpp:13:6: error: Array 'a[10]' accessed at index 10, which is out of bounds. [arrayIndexOutOfBounds]
a[10] = 0;
^
main.cpp:18:1: error: Memory leak: p [memleak]
}
^
main.cpp:15:10: style: Variable 'p' can be declared as pointer to const [constVariablePointer]
int *p;
^
main.cpp:7:12: style: Variable 'buf[x]' is assigned a value that is never used. [unreadVariable]
buf[x] = 0;
^
main.cpp:13:11: style: Variable 'a[10]' is assigned a value that is never used. [unreadVariable]
a[10] = 0;
^
main.cpp:16:7: style: Variable 'p' is assigned a value that is never used. [unreadVariable]
p = new int[10];
^
main.cpp:16:5: style: Variable 'p' is allocated memory that is never used. [unusedAllocatedMemory]
p = new int[10];
^
nofile:0:0: information: Active checkers: 168/966 (use --checkers-report= to see details) [checkersReport]

➜ ScratchPad git:(main) ✗

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions