Support for extern pointer for located variables
authoretisserant
Mon, 23 Jun 2008 18:02:09 +0200
changeset 122 9e57c6d79398
parent 121 9e8ce092e169
child 123 a9b4af71cfa4
Support for extern pointer for located variables
stage4/generate_c/generate_c_vardecl.cc
--- a/stage4/generate_c/generate_c_vardecl.cc	Mon May 19 14:07:31 2008 +0200
+++ b/stage4/generate_c/generate_c_vardecl.cc	Mon Jun 23 18:02:09 2008 +0200
@@ -972,7 +972,7 @@
       s4o.print(nv->get());
       s4o.print("{extern ");
       this->current_var_type_symbol->accept(*this);
-      s4o.print(" ");
+      s4o.print("* ");
       symbol->location->accept(*this);
       s4o.print("; ");
       print_variable_prefix();
@@ -980,7 +980,7 @@
         symbol->variable_name->accept(*this);
       else
         symbol->location->accept(*this);
-      s4o.print(" = &");
+      s4o.print(" = ");
       symbol->location->accept(*this);
       s4o.print(";}");
       break;
@@ -1211,7 +1211,7 @@
       if (symbol->global_var_name != NULL) {
         s4o.print("extern ");
         this->current_var_type_symbol->accept(*this);
-        s4o.print(" ");
+        s4o.print("* ");
         symbol->location->accept(*this);
         s4o.print(";\n");
         if (wanted_varformat == localstatic_vf)
@@ -1219,7 +1219,7 @@
         this->current_var_type_symbol->accept(*this);
         s4o.print(" *");
         symbol->global_var_name->accept(*this);
-        s4o.print(" = &");
+        s4o.print(" = ");
         symbol->location->accept(*this);
         s4o.print(";\n");
       }