diff --git a/src/language.yacc b/src/language.yacc index c35a673a01c4881681762ca1f6ec05e8ac01f80b..5993186c454dd6b154f92ebcee9904185bcc8cba 100644 --- a/src/language.yacc +++ b/src/language.yacc @@ -110,7 +110,7 @@ /* This is the grammar definition of Pike. */ #include "global.h" -RCSID("$Id: language.yacc,v 1.214 2000/09/26 22:19:03 hubbe Exp $"); +RCSID("$Id: language.yacc,v 1.215 2000/10/04 05:07:51 hubbe Exp $"); #ifdef HAVE_MEMORY_H #include <memory.h> #endif @@ -3332,6 +3332,14 @@ int low_add_local_name(struct compiler_frame *frame, "previous declaration on line %d\n", STR0(str), frame->variable[tmp].line); } + + if(type == void_type_string) + { + if(str->size_shift) + my_yyerror("Local variables cannot be of type of 'void'.\n"); + else + my_yyerror("Local variable '%s' is void.\n",STR0(str)); + } } debug_malloc_touch(def);