I have some files with .c extensions that use features of C++. Syntastic is checking these files with C checker which is reporting errors. Can you force synstastic to use C++ checker for .c files?
Asked
Active
Viewed 898 times
0
-
There are few ways to achieve that: you can set `filetype` for your C files to `cpp`, or you can use `syntastic_filetype_map`, or you can run `:SyntasticCheck cpp/gcc` etc., or you can add `cpp/gcc` to `syntastic_c_checkers`, or you can add `cpp/gcc` etc. to `b:syntastic_checkers`. It's all in the manual. – lcd047 Jul 24 '17 at 13:53
-
Thanks. g:syntastic_c_checkers = ['g++'] seems to work as well as g:syntastic_filetype_map = { "c": "cc"}. – fstop_22 Jul 24 '17 at 14:07
-
Actually, setting `g:syntastic_c_checkers` to `['g++']` has no useful effect (the useless effects may include producing a warning). `g++` is not a known checker, and `+` is not a valid character in a checker's name. – lcd047 Jul 24 '17 at 16:04
-
Yes, you are correct. That was a typo and should have been ['cpp']. However, after further inspection :SyntasticInfo is returning curenntly enabled checkers = '-' after setting g:syntastic_c_checkers to ['cpp']. – fstop_22 Jul 24 '17 at 17:58
-
_That was a typo and should have been ['cpp']._ - That isn't what I said. Try it with `['cpp/gcc']`, literally (assuming a decently recent version of syntastic). – lcd047 Jul 24 '17 at 18:13
-
With g:syntastic_c_checkers = ['cpp/gcc'] enabled checkers = cpp/gcc. However, file is not being checked. – fstop_22 Jul 24 '17 at 18:22
-
Then please open an issue at the [issue tracker](https://github.com/vim-syntastic/syntastic/issues). Make sure to explain what did you do, what did you expect to happen, and what happened instead. – lcd047 Jul 24 '17 at 20:31