Branch: Tag:

2000-10-04

2000-10-04 05:07:51 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

void local variables now gives an error

Rev: src/language.yacc:1.215

110:   /* 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:    "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);    debug_malloc_touch(type);