undid the hackup of const and volatile, the problem is much bigger
[fw/sdcc] / src / SDCCglue.c
index 22af1da0f784aa77e84af58fff25718008f98005..400f36ffd59a6c0411c69564c339158de421f4d3 100644 (file)
@@ -408,6 +408,7 @@ initPointer (initList * ilist, sym_link *toType)
                        val->type = newLink (DECLARATOR);
                        if (SPEC_SCLS (expr->left->etype) == S_CODE) {
                                DCL_TYPE (val->type) = CPOINTER;
+                               DCL_TYPE (val->type) = port->mem.code_ro;
                        }
                        else if (SPEC_SCLS (expr->left->etype) == S_XDATA)
                                DCL_TYPE (val->type) = FPOINTER;
@@ -466,6 +467,7 @@ initPointer (initList * ilist, sym_link *toType)
                val->type = newLink (DECLARATOR);
                if (SPEC_SCLS (expr->right->etype) == S_CODE) {
                        DCL_TYPE (val->type) = CPOINTER;
+                       DCL_PTR_CONST (val->type) = port->mem.code_ro;
                }
                else if (SPEC_SCLS (expr->right->etype) == S_XDATA)
                        DCL_TYPE (val->type) = FPOINTER;