diff --git a/doc/syntastic-checkers.txt b/doc/syntastic-checkers.txt index cff6d9fb..729a53a7 100644 --- a/doc/syntastic-checkers.txt +++ b/doc/syntastic-checkers.txt @@ -895,17 +895,39 @@ SYNTAX CHECKERS FOR C++ *syntastic-checkers-cpp* The following checkers are available for C++ (filetype "cpp"): - 1. ClangCheck...............|syntastic-cpp-clang_check| - 2. Clang-Tidy...............|syntastic-cpp-clang_tidy| - 3. Cppcheck.................|syntastic-cpp-cppcheck| - 4. Cpplint..................|syntastic-cpp-cpplint| - 5. GCC......................|syntastic-cpp-gcc| - 6. OClint...................|syntastic-cpp-oclint| - 7. PC-Lint..................|syntastic-cpp-pc_lint| - 8. Vera++...................|syntastic-cpp-verapp| + 1. AVR-GCC..................|syntastic-cpp-avrgcc| + 2. ClangCheck...............|syntastic-cpp-clang_check| + 3. Clang-Tidy...............|syntastic-cpp-clang_tidy| + 4. Cppcheck.................|syntastic-cpp-cppcheck| + 5. Cpplint..................|syntastic-cpp-cpplint| + 6. GCC......................|syntastic-cpp-gcc| + 7. OClint...................|syntastic-cpp-oclint| + 8. PC-Lint..................|syntastic-cpp-pc_lint| + 9. Vera++...................|syntastic-cpp-verapp| ------------------------------------------------------------------------------ -1. ClangCheck *syntastic-cpp-clang_check* +1. AVR-GCC *syntastic-cpp-avrgcc* + +Name: avrgcc +Maintainer: Sławek Piotrowski + +Checker options~ + +This checker is initialised using the "makeprgBuild()" function and thus it +accepts the standard options described at |syntastic-config-makeprg|. + +Additionally: + + *g:syntastic_avrgcc_config_file* +Type: string +Default: ".syntastic_avrgcc_config" +File containing compilation flags (such as defines or include directories), +one option per line (cf. |syntastic-config-files|). + +See also: |syntastic-c-avrgcc|. + +------------------------------------------------------------------------------ +2. ClangCheck *syntastic-cpp-clang_check* Name: clang_check Maintainer: Benjamin Bannier @@ -948,7 +970,7 @@ then ignored. See also: |syntastic-c-clang_check|. ------------------------------------------------------------------------------ -2. Clang-Tidy *syntastic-cpp-clang_tidy* +3. Clang-Tidy *syntastic-cpp-clang_tidy* Name: clang_tidy Maintainer: Benjamin Bannier @@ -999,7 +1021,7 @@ then ignored. See also: |syntastic-c-clang_tidy|. ------------------------------------------------------------------------------ -3. Cppcheck *syntastic-cpp-cppcheck* +4. Cppcheck *syntastic-cpp-cppcheck* Name: cppcheck Maintainer: LCD 47 @@ -1025,7 +1047,7 @@ one option per line (cf. |syntastic-config-files|). See also: |syntastic-c-cppcheck|. ------------------------------------------------------------------------------ -4. Cpplint *syntastic-cpp-cpplint* +5. Cpplint *syntastic-cpp-cpplint* Name: cpplint Maintainer: LCD 47 @@ -1061,7 +1083,7 @@ However, if your "cpplint" was installed with "pip", the script's name is let g:syntastic_cpp_cpplint_exec = "cpplint" < ------------------------------------------------------------------------------ -5. GCC *syntastic-cpp-gcc* +6. GCC *syntastic-cpp-gcc* Name: gcc Maintainer: Gregor Uhlenheuer @@ -1158,7 +1180,7 @@ executable. See also: |syntastic-c-gcc|. ------------------------------------------------------------------------------ -6. OClint *syntastic-cpp-oclint* +7. OClint *syntastic-cpp-oclint* Name: oclint Maintainer: "UnCO" Lin @@ -1198,7 +1220,7 @@ Config files pointed to by 'g:syntastic_oclint_config_file' are then ignored. See also: |syntastic-c-oclint|. ------------------------------------------------------------------------------ -7. PC-Lint *syntastic-cpp-pc_lint* +8. PC-Lint *syntastic-cpp-pc_lint* Name: pc_lint Maintainer: Steve Bragg @@ -1225,7 +1247,7 @@ current directory and in parent directories; first such file found is used. See also: |syntastic-c-pc_lint|. ------------------------------------------------------------------------------ -8. Vera++ *syntastic-cpp-verapp* +9. Vera++ *syntastic-cpp-verapp* Name: verapp Maintainer: Lucas Verney @@ -6838,6 +6860,7 @@ syntastic-specific configuration files: OpenCOBOL (|syntastic-cobol-cobc|) C++~ + AVR-GCC (|syntastic-cpp-avrgcc|) ClangCheck (|syntastic-cpp-clang_check|) Clang-Tidy (|syntastic-cpp-clang_tidy|) Cppcheck (|syntastic-cpp-cppcheck|) diff --git a/syntax_checkers/cpp/avrgcc.vim b/syntax_checkers/cpp/avrgcc.vim new file mode 100644 index 00000000..64c6ad1a --- /dev/null +++ b/syntax_checkers/cpp/avrgcc.vim @@ -0,0 +1,57 @@ +"============================================================================ +"File: avrgcc.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Sławek Piotrowski +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists('g:loaded_syntastic_cpp_avrgcc_checker') + finish +endif +let g:loaded_syntastic_cpp_avrgcc_checker = 1 + +if !exists('g:syntastic_avrgcc_config_file') + let g:syntastic_avrgcc_config_file = '.syntastic_avrgcc_config' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_cpp_avrgcc_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'args_before': syntastic#c#ReadConfig(g:syntastic_avrgcc_config_file), + \ 'args_after': '-x c++ -fsyntax-only' }) + + let errorformat = + \ '%-G%f:%s:,' . + \ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' . + \ '%-G%f:%l: %#error: %#for each function it appears%.%#,' . + \ '%-GIn file included%.%#,' . + \ '%-G %#from %f:%l\,,' . + \ '%f:%l:%c: %trror: %m,' . + \ '%f:%l:%c: %tarning: %m,' . + \ '%f:%l:%c: %m,' . + \ '%f:%l: %trror: %m,' . + \ '%f:%l: %tarning: %m,'. + \ '%f:%l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['compressWhitespace'] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cpp', + \ 'name': 'avrgcc', + \ 'exec': 'avr-g++'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: