-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add new option 'g:syntastic_c_cflags_file' for C syntax checker to specify a file with CFLAGS. #215
Conversation
The file specified by this option may contain CFLAGS that will be added to the compiler. If you e.g. already use clang_complete and set up a .clang_complete configuration file with compiler flags that can be used here without any modification.
@kongo2002 is in charge of the c/c++ syntax checkers, so I will wait for his feedback on this. I would suggest shifting the |
I think, it would be better if the flag is stored in a file in current directory, such as |
I think I like the idea of a separate configuration file like I'll look into this later today. |
I would much prefer it if this could be integrated with clang_complete plugin. Clang_complete reads |
@@ -68,6 +73,38 @@ if !exists('g:syntastic_c_compiler_options') | |||
let g:syntastic_c_compiler_options = '-std=gnu99' | |||
endif | |||
|
|||
" This function was stolen from clang_complete | |||
function! s:parseConfig(file) | |||
let l:local_conf = findfile(a:file, getcwd() . ',.;') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To find config file starting the search from the directory of the file opened in vim (instead of cwd):
@xuhdev that's what the diff does, I just set g:syntastic_c_cflags_file to '.clang_complete'. Perhaps it'd be event better to start the search for the config file from the directory of the source file opened in vim, instead of cwd (see note above). |
@ldx I agree with this. Yes, making But I was wondering whether we could make a fundamental layer for all the plugins requiring a configuration in the directory where the source file locates for vim (and maybe for other editors). I am current working on a project called EditorConfig, which should be proper for this situation. Maybe I could try to do something for this (for both However, a basic configuration as @ldx has done is necessary. Thank you very much for your patch. |
I have merged in #220 which which makes the changes as discussed. Try it out! Any comments or suggestions can be posted here :) If configuration files are implemented for another language then I will definitely try to write a general architecture for it in the syntastic core - but lets focus on that when it happens. |
The file specified by this option may contain CFLAGS that will be
added to the compiler. If you e.g. already use clang_complete and
set up a .clang_complete configuration file with compiler flags
that can be used here without any modification.