From 5e64acc6abeb61d4a10864b24df763327663f240 Mon Sep 17 00:00:00 2001 From: w0rp Date: Mon, 20 May 2019 13:00:32 +0100 Subject: Fix #2512 - Use -o /dev/null for gcc linting --- ale_linters/asm/gcc.vim | 5 ++++- ale_linters/c/gcc.vim | 6 +++++- ale_linters/cpp/gcc.vim | 6 +++++- 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'ale_linters') diff --git a/ale_linters/asm/gcc.vim b/ale_linters/asm/gcc.vim index 72b293c0..eecab6ef 100644 --- a/ale_linters/asm/gcc.vim +++ b/ale_linters/asm/gcc.vim @@ -5,7 +5,10 @@ call ale#Set('asm_gcc_executable', 'gcc') call ale#Set('asm_gcc_options', '-Wall') function! ale_linters#asm#gcc#GetCommand(buffer) abort - return '%e -x assembler -fsyntax-only ' + " `-o /dev/null` or `-o null` is needed to catch all errors, + " -fsyntax-only doesn't catch everything. + return '%e -x assembler' + \ . ' -o ' . g:ale#util#nul_file \ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) \ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -' endfunction diff --git a/ale_linters/c/gcc.vim b/ale_linters/c/gcc.vim index d965965d..1df1018e 100644 --- a/ale_linters/c/gcc.vim +++ b/ale_linters/c/gcc.vim @@ -9,7 +9,11 @@ function! ale_linters#c#gcc#GetCommand(buffer, output) abort " -iquote with the directory the file is in makes #include work for " headers in the same directory. - return '%e -S -x c -fsyntax-only' + " + " `-o /dev/null` or `-o null` is needed to catch all errors, + " -fsyntax-only doesn't catch everything. + return '%e -S -x c' + \ . ' -o ' . g:ale#util#nul_file \ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) \ . ale#Pad(l:cflags) \ . ale#Pad(ale#Var(a:buffer, 'c_gcc_options')) . ' -' diff --git a/ale_linters/cpp/gcc.vim b/ale_linters/cpp/gcc.vim index c427020b..108d6d70 100644 --- a/ale_linters/cpp/gcc.vim +++ b/ale_linters/cpp/gcc.vim @@ -9,7 +9,11 @@ function! ale_linters#cpp#gcc#GetCommand(buffer, output) abort " -iquote with the directory the file is in makes #include work for " headers in the same directory. - return '%e -S -x c++ -fsyntax-only' + " + " `-o /dev/null` or `-o null` is needed to catch all errors, + " -fsyntax-only doesn't catch everything. + return '%e -S -x c++' + \ . ' -o ' . g:ale#util#nul_file \ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) \ . ale#Pad(l:cflags) \ . ale#Pad(ale#Var(a:buffer, 'cpp_gcc_options')) . ' -' -- cgit v1.2.3