alexmurray/flycheck-clang-analyzer

Ccls support

innerout opened this issue · 14 comments

Does this plugin support Ccls?It is a fork of cquery.

Not currently but from a quick look it seems like a ccls backend could be added which just uses the same forked functions as the cquery one - if I add something could you test it?

Going to test and give some feedback later.

This error is being reported when using the ccls branch. Also i tried the master branch with cquery and it does not trigger this behaviour.

Suspicious state from syntax checker clang-analyzer: Flycheck checker clang-analyzer returned 
non-zero exit code 1, but its output contained no errors: clang-6.0: fatal error: 
cannot specify -o when generating multiple output files

Try installing a more recent version of clang-analyzer, and please 
open a bug report if the issue persists in the latest release.  Thanks!

Can you try the following and post the output when using the ccls branch:

M-:
(flycheck-clang-analyzer--ccls-get-compile-options)

And then also do the equivalent for the cquery backend on the master branch:

M-:
(flycheck-clang-analyzer--cquery-get-compile-options)

I think the ccls backend is adding extra arguments which aren't in the cquery one to the compiler flags which we will likely need to filter out.

For cquery the command reports
("-working-directory=/home/geo/HEutropia/kreon" "-g" "-ggdb3" "-Wall" "-O3" "-DSTANDALONE" "-Wfatal-errors" "-pthread" "-fPIC" "/home/geo/HEutropia/kreon/btree/btree.c" "-resource-dir=/home/geo/cquery/build/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-14.04/lib/clang/6.0.0" "-Wno-unknown-warning-option" ...)

For ccls the command reports

("-c" "-g" "-ggdb3" "-Wall" "-O3" "-DSTANDALONE" "-Wfatal-errors" "-pthread" "-fPIC" "-o" "btree/btree.o" "/home/geo/HEutropia/kreon/btree/btree.c" ...)

Can you try the latest change I just pushed to the ccls-support branch?

I am gonna test and give feedback soon.

I tested on 2 different projects(small-big size) both seemed to work just fine.
The only problem i encountered when i ran it with a big C file with 5k LOC, is that flycheck-clang-analyzer is being disabled because it reports more than 600 warnings-errors. I realize it is not a problem of the flycheck-clang-analyzer but has this behaviour occurred to you?

Great to hear it works! Any chance you can test via cquery as well (but on this new ccls branch) to check we haven't broken cquery support? Then I will merge this to master.

No I haven't seen that before - are they all real / correct warnings?

I don't know if they are real / correct warnings because as soon as the message is printed flycheck-clang-analyzer is disabled.

You could try increasing the limit by setting flycheck-checker-error-threshold to a higher value (I am pretty sure this is the variable which governs that)

You were correct.After changing the value of the variable this error is not being reported.
Also cquery is working fine.

Great - thanks for all your testing. I'll merge it to master and it should be available on MELPA in 24h.