Dan Hipschman : widl: Generate an error for "int f(void a)".

Alexandre Julliard julliard at wine.codeweavers.com
Thu Sep 7 03:45:48 CDT 2006


Module: wine
Branch: master
Commit: 1687a5d1db2c0bcd3f7155c6195d500b7959010b
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=1687a5d1db2c0bcd3f7155c6195d500b7959010b

Author: Dan Hipschman <dsh at linux.ucla.edu>
Date:   Tue Aug 29 14:29:06 2006 -0700

widl: Generate an error for "int f(void a)".

---

 tools/widl/parser.y |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 0121bca..8cbddcd 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -106,6 +106,7 @@ static void write_iid(type_t *iface);
 static int compute_method_indexes(type_t *iface);
 static char *gen_name(void);
 static void process_typedefs(var_t *names);
+static void check_arg(var_t *arg);
 
 #define tsENUM   1
 #define tsSTRUCT 2
@@ -319,8 +320,8 @@ m_args:						{ $$ = NULL; }
 no_args:  tVOID					{ $$ = NULL; }
 	;
 
-args:	  arg
-	| args ',' arg				{ LINK($3, $1); $$ = $3; }
+args:	  arg					{ check_arg($1); $$ = $1; }
+	| args ',' arg				{ check_arg($3); LINK($3, $1); $$ = $3; }
 	| no_args
 	;
 
@@ -1678,3 +1679,11 @@ static void process_typedefs(var_t *name
     names = next;
   }
 }
+
+static void check_arg(var_t *arg)
+{
+  type_t *t = arg->type;
+
+  if (t->type == 0 && ! is_var_ptr(arg))
+    yyerror("argument '%s' has void type", arg->name);
+}




More information about the wine-cvs mailing list