aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stefaniuc <mstefani@redhat.com>2009-09-30 21:34:56 +0000
committerChristopher <sparse@chrisli.org>2010-03-28 17:51:36 -0700
commit008e1c61f41127d05316a85449571721c1ec0411 (patch)
treea22b86e01b8bc8f85d83ed4d7982729f96975c27
parentSimplify Makefile using static pattern rules (diff)
downloadsparse-008e1c61f41127d05316a85449571721c1ec0411.tar.gz
sparse-008e1c61f41127d05316a85449571721c1ec0411.tar.bz2
sparse-008e1c61f41127d05316a85449571721c1ec0411.zip
Handle __builtin_ms_va_list.
For Win64 compiles Wine does #ifndef __ms_va_list # if defined(__x86_64__) && defined (__GNUC__) # define __ms_va_list __builtin_ms_va_list # define __ms_va_start(list,arg) __builtin_ms_va_start(list,arg) # define __ms_va_end(list) __builtin_ms_va_end(list) # else Wouldn't be as bad if sparse cannot handle those but it trips over WINBASEAPI DWORD WINAPI FormatMessageA(DWORD,LPCVOID,DWORD,DWORD,LPSTR,DWORD,__ms_va_list*); WINBASEAPI DWORD WINAPI FormatMessageW(DWORD,LPCVOID,DWORD,DWORD,LPWSTR,DWORD,__ms_va_list*); producing this errors for basically every file: wine/include/winbase.h:1546:96: error: Expected ) in function declarator wine/include/winbase.h:1546:96: error: got * wine/include/winbase.h:1547:97: error: Expected ) in function declarator wine/include/winbase.h:1547:97: error: got * Signed-off-by: Michael Stefaniuc <mstefaniuc@gmail.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
-rw-r--r--lib.c2
-rw-r--r--parse.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 622b547..cf00c8b 100644
--- a/lib.c
+++ b/lib.c
@@ -794,11 +794,13 @@ void create_builtin_stream(void)
add_pre_buffer("#define __builtin_stdarg_start(a,b) ((a) = (__builtin_va_list)(&(b)))\n");
add_pre_buffer("#define __builtin_va_start(a,b) ((a) = (__builtin_va_list)(&(b)))\n");
+ add_pre_buffer("#define __builtin_ms_va_start(a,b) ((a) = (__builtin_ms_va_list)(&(b)))\n");
add_pre_buffer("#define __builtin_va_arg(arg,type) ({ type __va_arg_ret = *(type *)(arg); arg += sizeof(type); __va_arg_ret; })\n");
add_pre_buffer("#define __builtin_va_alist (*(void *)0)\n");
add_pre_buffer("#define __builtin_va_arg_incr(x) ((x) + 1)\n");
add_pre_buffer("#define __builtin_va_copy(dest, src) ({ dest = src; (void)0; })\n");
add_pre_buffer("#define __builtin_va_end(arg)\n");
+ add_pre_buffer("#define __builtin_ms_va_end(arg)\n");
/* FIXME! We need to do these as special magic macros at expansion time! */
add_pre_buffer("#define __BASE_FILE__ \"base_file.c\"\n");
diff --git a/parse.c b/parse.c
index c3f9b6a..6ab2ac4 100644
--- a/parse.c
+++ b/parse.c
@@ -391,6 +391,7 @@ static struct init_keyword {
/* Predeclared types */
{ "__builtin_va_list", NS_TYPEDEF, .type = &ptr_ctype, .op = &spec_op },
+ { "__builtin_ms_va_list", NS_TYPEDEF, .type = &ptr_ctype, .op = &spec_op },
{ "__int128_t", NS_TYPEDEF, .type = &lllong_ctype, .op = &spec_op },
{ "__uint128_t",NS_TYPEDEF, .type = &ulllong_ctype, .op = &spec_op },