From f8a4beea824b50bf05d27df816b1f4672d5a21e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Tue, 3 Oct 2000 22:07:51 -0700
Subject: [PATCH] void local variables now gives an error

Rev: src/language.yacc:1.215
---
 src/language.yacc | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/language.yacc b/src/language.yacc
index c35a673a01..5993186c45 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);
-- 
GitLab