linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Handle __builtin_ms_va_list.
@ 2009-09-30 21:34 Michael Stefaniuc
  2009-10-01 18:41 ` Christopher Li
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Stefaniuc @ 2009-09-30 21:34 UTC (permalink / raw)
  To: linux-sparse

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>
---
 lib.c   |    2 ++
 parse.c |    1 +
 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 },
 
-- 
1.6.5.rc2

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-02-02  8:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-30 21:34 Handle __builtin_ms_va_list Michael Stefaniuc
2009-10-01 18:41 ` Christopher Li
2009-11-25 14:15   ` Getting info from used typedef Thomas Schmid
2009-11-30 23:41     ` Christopher Li
2009-12-01 12:30       ` Antwort: " Thomas Schmid
2009-12-01 18:49         ` Christopher Li
2009-12-02 14:05           ` Thomas Schmid
2010-01-21  0:38             ` Christopher Li
2010-01-26 15:28               ` Thomas Schmid
2010-01-29  1:21                 ` Christopher Li
2010-02-02  8:52                   ` Thomas Schmid

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).