Fix bug - correctly declare struct members whose type is a directly defined array (e.g.: STRUCT x: ARRAY of XXX; END_STRUCT)
--- a/stage4/generate_c/generate_c.cc Wed Feb 05 20:04:50 2014 +0000
+++ b/stage4/generate_c/generate_c.cc Sat Feb 08 10:32:26 2014 +0000
@@ -855,11 +855,20 @@
void *visit(array_spec_init_c *symbol) {
switch (current_mode) {
case arraydeclaration_im:
+ {
+ array_specification_c *specification = dynamic_cast<array_specification_c*>(symbol->array_specification);
+ if (specification != NULL)
+ symbol->array_specification->accept(*this);
+ }
+ break;
case arrayname_im:
{
array_specification_c *specification = dynamic_cast<array_specification_c*>(symbol->array_specification);
if (specification != NULL)
symbol->array_specification->accept(*this);
+ identifier_c *name = dynamic_cast<identifier_c*>(symbol->array_specification);
+ if (name != NULL)
+ s4o_incl.print(name->value);
}
break;
default: