summaryrefslogtreecommitdiff
path: root/ale_linters/c/clang.vim
blob: 205dd922b62bcf40b8997f4f1347fa1ac957cf64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
" Author: Masahiro H https://github.com/mshr-h
" Description: clang linter for c files

" Set this option to change the Clang options for warnings for C.
if !exists('g:ale_c_clang_options')
    " let g:ale_c_clang_options = '-Wall'
    " let g:ale_c_clang_options = '-std=c99 -Wall'
    " c11 compatible
    let g:ale_c_clang_options = '-std=c11 -Wall'
endif

call ale#linter#Define('c', {
\   'name': 'clang',
\   'output_stream': 'stderr',
\   'executable': 'clang',
\   'command': 'clang -S -x c -fsyntax-only '
\       . g:ale_c_clang_options
\       . ' -',
\   'callback': 'ale#handlers#HandleGCCFormat',
\})