alexmurray / flycheck-clang-analyzer

Integrate Clang Static Analyzer with flycheck for on-the-fly static analysis in Emacs
35 stars 5 forks source link

Spacemacs: "Flycheck cannot use this syntax checker for this buffer" #15

Closed Maverobot closed 5 years ago

Maverobot commented 5 years ago

Hello,

I have been trying to include this package in my spacemacs config. I undertook the following steps:

(use-package flycheck-clang-analyzer
  :ensure t
  :after flycheck
  :config (flycheck-clang-analyzer-setup))

However, when trying to select clang-analyzer as checker, an error occured:

Syntax checker in buffer hello_world.h in c++-mode:

  clang-analyzer
    - major mode: `c++-mode' supported
    - may enable: yes
    - predicate:  nil
    - executable: Found at /usr/bin/clang
    - Backend:    flycheck-clang

Flycheck cannot use this syntax checker for this buffer.

Flycheck Mode is enabled. Use SPC u C-c ! x to enable disabled checkers.

--------------------

Flycheck version: 32snapshot (package: 20190311.1422)
Emacs version:    26.1
System:           x86_64-pc-linux-gnu
Window system:    x

It would be very helpful if someone can shed some light on this issue. Thanks!

alexmurray commented 5 years ago

We purposely disable the checker for header buffers since these often come with a lot of false positives from clang-analyzer. So this is expected behaviour in this case for a hello_world.h file

Maverobot commented 5 years ago

Amazing, thanks! I don't know why I did not try with a cpp file.