pike.git/
src/
language.yacc
Branch:
Tag:
Non-build tags
All tags
No tags
1999-12-17
1999-12-17 23:06:07 by Henrik Grubbström (Grubba) <grubba@grubba.org>
5fdb4dbeb3dbba8abf02a35f9d17fffc08a55b97 (
9
lines) (+
8
/-
1
)
[
Show
|
Annotate
]
Branch:
7.9
Added warning about declaring local variables with type void.
Rev: src/language.yacc:1.151
185:
/* This is the grammar definition of Pike. */ #include "global.h"
-
RCSID("$Id: language.yacc,v 1.
150
1999/12/17
21
:
09
:
48
hubbe
Exp $");
+
RCSID("$Id: language.yacc,v 1.
151
1999/12/17
23
:
06
:
07
grubba
Exp $");
#ifdef HAVE_MEMORY_H #include <memory.h> #endif
2580:
#ifdef PIKE_DEBUG check_type_string(type); #endif /* PIKE_DEBUG */
+
if (pike_type_le(type, void_type_string)) {
+
yywarning("Declaring local variable with type void "
+
"(converted to type zero).");
+
free_string(type);
+
copy_shared_string(type, zero_type_string);
+
}
compiler_frame->variable[compiler_frame->current_number_of_locals].type = type; compiler_frame->variable[compiler_frame->current_number_of_locals].name = str; compiler_frame->variable[compiler_frame->current_number_of_locals].def = def;