alexmurray / flycheck-clang-analyzer

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

Unable to use ccls as backend #14

Closed fuzzycode closed 5 years ago

fuzzycode commented 5 years ago

The function ccls--is-ccls-buffer has been removed in this commit. This causes the ccls backend to be reported as inactive and only the fallback solution will be used.

matthuszagh commented 5 years ago

I'm also unable to use flycheck-clang-analyzer with ccls.

alexmurray commented 5 years ago

@matthuszagh what version if emacs-ccls and flycheck-clang-analyzer are you using? This issue (as originally reported by @fuzzycode) was fixed a few months ago with https://github.com/alexmurray/flycheck-clang-analyzer/commit/2775a63456c1c8c9a94ae28ebad230c6e23027da

matthuszagh commented 5 years ago

I'm using

flycheck-clang-analyzer: 20190724.542 emacs-ccls: 20190720.935

In case it's useful, my setup is

(use-package flycheck-clang-analyzer
     :after flycheck
     :config
     (flycheck-clang-analyzer-setup))
alexmurray commented 5 years ago

Thanks - can you provide any more details on why you think it isn't working? What does M-x flycheck-verify-setup show? As a simple test if you paste the following into a file (say /tmp/test.c)

#include <stdlib.h>

int main() {
        char *p = malloc(100);
}

It should show two warnings detected by flycheck-clang-analyzer - (M-x flycheck-list-errors):

 test.c     4  15 warning         Value stored to 'p' during its initialization is never read (clang-analyzer)
 test.c     5   1 warning         Potential leak of memory pointed to by 'p' (clang-analyzer)
matthuszagh commented 5 years ago

Nevermind, this does indeed work. I'm not entirely sure what the issue was, but deleting the ccls cache and restarting worked. Sorry for the false alarm and thanks for the help!

alexmurray commented 5 years ago

No worries.