Saturday, January 23, 2016

Syntastic check for clang (LLVM) on windows with third party libraries

I'm having a strange issue when using clang as my checker under syntastic
plugin on Win 7. I'm using official GVim74 and Windows 7 x64. Clang is
downloaded from http://llvm.org/releases/download.html
<http://llvm.org/releases/download.html>
and the version is LLVM 3.7.1.

Here is my configuration for syntastic plugin:
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_c_checkers=['gcc', 'cppcheck', 'splint', 'clang_check']
let g:syntastic_cpp_checkers=['gcc', 'cppcheck', 'clang_check']
let g:syntastic_c_compiler_options = '-W -Wall -Wextra -fsized-deallocation
-pedantic -ansi -std=c99 -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wnested-externs -Wzero-as-null-pointer-constant
-Wformat=2 -Wformat-security -Wformat-signedness -Wformat-y2k
-Wnull-dereference -Wconversion'
let g:syntastic_cpp_compiler_options = '-W -Wall -Wextra
-fsized-deallocation -pedantic -ansi -std=c99 -std=gnu++98 -std=gnu++11
-std=gnu++14 -stdlib=libc++ -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wnested-externs -Wzero-as-null-pointer-constant
-Wformat=2 -Wformat-security -Wformat-signedness -Wformat-y2k
-Wnull-dereference -Wconversion'
let g:syntastic_aggregate_errors = 1
let g:syntastic_always_populate_loc_list = 1
" let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_enable_signs=1
" let g:syntastic_cpp_include_dirs = ['libs/dir2/dir3', 'libs/dir2 ]
let g:syntastic_cpp_check_header = 1
let g:syntastic_cpp_remove_include_errors = 1
let g:syntastic_cpp_config_file = '$HOME/.syntastic_include_dir.txt'
let g:syntastic_cpp_config_file = '.syntastic_include_dir.txt'
let g:syntastic_c_config_file = '$HOME/.syntastic_include_dir.txt'
let g:syntastic_c_config_file = '.syntastic_include_dir.txt'
let g:syntastic_c_check_header = 1
let g:syntastic_cpp_check_header = 1
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And here is my ".syntastic_include_dir.txt" in %USERPROFILE%

-I"C:\CODEBL~1\TDM-GC~1\include"
-I"C:\CODEBL~1\TDM-GC~1\lib\gcc\X86_64~1\51B983~1.0\include"
-I"C:\CODEBL~1\TDM-GC~1\lib\gcc\X86_64~1\51B983~1.0\include\C__~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\GL"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\GLFW"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\glm"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\glm\gtx"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\glm\gtc"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\sys"
-I"C:\xtralibs\appu"
-I"C:\xtralibs\yxml11"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\ACCUMU~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\ALGORI~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\align"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\archive"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\asio"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\assign"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\atomic"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\bimap"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\bind"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\chrono"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\CIRCUL~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\concept"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\CONCEP~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\config"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\CONTAI~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\context"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\convert"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\core"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\COROUT~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\COROUT~2"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\DATE_T~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\detail"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\DYNAMI~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\endian"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\EXCEPT~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\FILESY~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\FLYWEI~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\format"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\function"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\FUNCTI~2"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\FUNCTI~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\fusion"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\geometry"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\gil"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\graph"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\heap"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\icl"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\integer"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\INTERP~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\INTRUS~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\io"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\IOSTRE~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\iterator"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\lambda"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\LEXICA~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\LOCAL_~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\locale"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\lockfree"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\log"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\logic"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\math"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\move"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\mpi"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\mpl"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\msm"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\MULTI_~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\MULTI_~2"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\MULTIP~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\numeric"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\optional"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\PARAME~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\pending"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\phoenix"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\polygon"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\pool"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\predef"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\PREPRO~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\PROGRA~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\PROPER~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\PROPER~2"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\proto"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\PTR_CO~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\python"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\random"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\range"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\ratio"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\regex"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\regex"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\SERIAL~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\signals"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\signals2"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\SMART_~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\sort"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\spirit"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\STATEC~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\system"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\test"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\thread"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\timer"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\tr1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\tti"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\tuple"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\TYPE_E~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\TYPE_I~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\TYPE_T~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\units"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\UNORDE~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\utility"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\uuid"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\variant"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\vmd"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\wave"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\boost\XPRESS~1"
-I"C:\CODEBL~1\TDM-GC~1\X86_64~1\include\SDL2"
-I"C:\WXWIDG~1.2\include\msvc\wx"
-I"C:\WXWIDG~1.2\include\wx"
-I"C:\WXWIDG~1.2\include\wx\android"
-I"C:\WXWIDG~1.2\include\wx\aui"
-I"C:\WXWIDG~1.2\include\wx\generic"
-I"C:\WXWIDG~1.2\include\wx\html"
-I"C:\WXWIDG~1.2\include\wx\meta"
-I"C:\WXWIDG~1.2\include\wx\msw"
-I"C:\WXWIDG~1.2\include\wx\persist"
-I"C:\WXWIDG~1.2\include\wx\private"
-I"C:\WXWIDG~1.2\include\wx\propgrid"
-I"C:\WXWIDG~1.2\include\wx\protocol"
-I"C:\WXWIDG~1.2\include\wx\ribbon"
-I"C:\WXWIDG~1.2\include\wx\richtext"
-I"C:\WXWIDG~1.2\include\wx\stc"
-I"C:\WXWIDG~1.2\include\wx\univ"
-I"C:\WXWIDG~1.2\include\wx\unix"
-I"C:\WXWIDG~1.2\include\wx\xml"
-I"C:\WXWIDG~1.2\include\wx\xrc"
-I"C:\xtralibs\GTK_-B~1.1-2\include"
-I"C:\xtralibs\GTK_-B~1.1-2\include\atk-1.0"
-I"C:\xtralibs\GTK_-B~1.1-2\include\atk-1.0\atk"
-I"C:\xtralibs\GTK_-B~1.1-2\include\cairo"
-I"C:\xtralibs\GTK_-B~1.1-2\include\FONTCO~1"
-I"C:\xtralibs\GTK_-B~1.1-2\include\FREETY~1"
-I"C:\xtralibs\GTK_-B~1.1-2\include\FREETY~1\freetype"
-I"C:\xtralibs\GTK_-B~1.1-2\include\gail-1.0"
-I"C:\xtralibs\GTK_-B~1.1-2\include\gail-1.0\LIBGAI~1"
-I"C:\xtralibs\GTK_-B~1.1-2\include\GDK-PI~1.0"
-I"C:\xtralibs\GTK_-B~1.1-2\include\GDK-PI~1.0\GDK-PI~1"
-I"C:\xtralibs\GTK_-B~1.1-2\include\glib-2.0"
-I"C:\xtralibs\GTK_-B~1.1-2\include\glib-2.0\gio"
-I"C:\xtralibs\GTK_-B~1.1-2\include\glib-2.0\glib"
-I"C:\xtralibs\GTK_-B~1.1-2\include\glib-2.0\gobject"
-I"C:\xtralibs\GTK_-B~1.1-2\include\gtk-2.0"
-I"C:\xtralibs\GTK_-B~1.1-2\include\gtk-2.0\gdk"
-I"C:\xtralibs\GTK_-B~1.1-2\include\gtk-2.0\gtk"
-I"C:\xtralibs\GTK_-B~1.1-2\include\libpng14"
-I"C:\xtralibs\GTK_-B~1.1-2\include\pango-1.0"
-I"C:\xtralibs\GTK_-B~1.1-2\include\pango-1.0\pango"
-I"C:\xtralibs\GTK_-B~1.1-2\include\pixman-1"

When I'm including a a header (a custom memory allocation routine that I
wrote for my personal use and use frequently) 'memalloctn.h' like:

test01.c

#include <errno.h>
#include <stdint.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memalloctn.h> /*I will be using a function from here*/
int main(void) {
Make2DintArray(); /*a deliberate mistake*/
system("PAUSE");
return EXIT_SUCCESS;
}

Syntastic reports back GCC complains that "too few arguments to function
'Make2DintArray' [c/gcc]" that is what I expected. It means GCC found the
header but checked I'm passing no proper argument to the function. But Clang
complains "'memalloctn.h' file not found [c/clang_check]".

Now my question is, how can I tell LLVM to search for my third-party and
custom headers in the specific directories and it has to be done with a list
from a text? And all these have to be done with syntastic. Any advice will
be a lot of help. Thanks in advance.



--
View this message in context: http://vim.1045645.n5.nabble.com/Syntastic-check-for-clang-LLVM-on-windows-with-third-party-libraries-tp5726705.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: