@@ -108,7 +108,7 @@ void opstack_push(var_t *var)
108108 operand_stack [operand_stack_idx ++ ] = var ;
109109}
110110
111- var_t * opstack_pop ()
111+ var_t * opstack_pop (void )
112112{
113113 return operand_stack [-- operand_stack_idx ];
114114}
@@ -179,7 +179,7 @@ int get_unary_operator_prio(opcode_t op)
179179 }
180180}
181181
182- opcode_t get_operator ()
182+ opcode_t get_operator (void )
183183{
184184 opcode_t op = OP_generic ;
185185 if (lex_accept (T_plus ))
@@ -317,7 +317,7 @@ int read_numeric_constant(char buffer[])
317317 return value ;
318318}
319319
320- int read_constant_expr_operand ()
320+ int read_constant_expr_operand (void )
321321{
322322 char buffer [MAX_ID_LEN ];
323323 int value ;
@@ -449,15 +449,15 @@ int read_constant_infix_expr(int precedence)
449449 return lhs ;
450450}
451451
452- int read_constant_expr ()
452+ int read_constant_expr (void )
453453{
454454 return read_constant_infix_expr (0 );
455455}
456456
457457/* Skips lines where preprocessor match is false, this will stop once next
458458 * token is either 'T_cppd_elif', 'T_cppd_else' or 'cppd_endif'.
459459 */
460- void cppd_control_flow_skip_lines ()
460+ void cppd_control_flow_skip_lines (void )
461461{
462462 while (!lex_peek (T_cppd_elif , NULL ) && !lex_peek (T_cppd_else , NULL ) &&
463463 !lex_peek (T_cppd_endif , NULL )) {
@@ -472,7 +472,7 @@ void check_def(char *alias, bool expected)
472472 preproc_match = true;
473473}
474474
475- void read_defined_macro ()
475+ void read_defined_macro (void )
476476{
477477 char lookup_alias [MAX_TOKEN_LEN ];
478478
@@ -487,7 +487,7 @@ void read_defined_macro()
487487/* read preprocessor directive at each potential positions: e.g.,
488488 * global statement / body statement
489489 */
490- bool read_preproc_directive ()
490+ bool read_preproc_directive (void )
491491{
492492 char token [MAX_ID_LEN ];
493493
@@ -728,6 +728,21 @@ void read_parameter_list_decl(func_t *func, int anon)
728728{
729729 int vn = 0 ;
730730 lex_expect (T_open_bracket );
731+
732+ char token [MAX_TYPE_LEN ];
733+ if (lex_peek (T_identifier , token ) && !strncmp (token , "void" , 4 )) {
734+ next_token = lex_token ();
735+ if (lex_accept (T_close_bracket ))
736+ return ;
737+ func -> param_defs [vn ].type = TY_void ;
738+ read_inner_var_decl (& func -> param_defs [vn ], anon , 1 );
739+ if (!func -> param_defs [vn ].is_ptr && !func -> param_defs [vn ].is_func &&
740+ !func -> param_defs [vn ].array_size )
741+ error ("'void' must be the only parameter and unnamed" );
742+ vn ++ ;
743+ lex_accept (T_comma );
744+ }
745+
731746 while (lex_peek (T_identifier , NULL ) == 1 ) {
732747 read_full_var_decl (& func -> param_defs [vn ++ ], anon , 1 );
733748 lex_accept (T_comma );
@@ -1954,7 +1969,7 @@ bool read_body_assignment(char *token,
19541969 return false;
19551970}
19561971
1957- int read_primary_constant ()
1972+ int read_primary_constant (void )
19581973{
19591974 /* return signed constant */
19601975 int isneg = 0 , res ;
@@ -2819,7 +2834,7 @@ void read_global_decl(block_t *block)
28192834 error ("Syntax error in global declaration" );
28202835}
28212836
2822- void read_global_statement ()
2837+ void read_global_statement (void )
28232838{
28242839 char token [MAX_ID_LEN ];
28252840 block_t * block = GLOBAL_BLOCK ; /* global block */
@@ -2938,7 +2953,7 @@ void read_global_statement()
29382953 error ("Syntax error in global statement" );
29392954}
29402955
2941- void parse_internal ()
2956+ void parse_internal (void )
29422957{
29432958 /* set starting point of global stack manually */
29442959 GLOBAL_FUNC = add_func ("" , true);
0 commit comments