]> git.gag.com Git - fw/sdcc/commitdiff
* src/SDCCsymt.c (structElemType): fixed bug #808291 (members
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 18 Sep 2003 15:00:43 +0000 (15:00 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 18 Sep 2003 15:00:43 +0000 (15:00 +0000)
of const struct should be treated as if const themselves)

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2897 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCsymt.c

index 5c211d47bb5595e9dd06c4cadbea9336bd7119fc..5bc2d441f7a1c53fc6b92cd42e8911b4775ae38f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-09-18  Erik Petrich <epetrich@ivorytower.norman.ok.us>
+
+       * src/SDCCsymt.c (structElemType): fixed bug #808291 (members
+       of const struct should be treated as if const themselves)
+
 2003-09-18  Bernhard Held <bernhard@bernhardheld.de>
        * src/SDCCval.c (valPlus, valMinus): fixed bug #808337
 
index 5f538398eb3ae764de52a8ec48911c0235195f55..48a558fd5c28b195e67046100fe3e1b56c413c27 100644 (file)
@@ -1048,6 +1048,10 @@ structElemType (sym_link * stype, value * id)
            etype = getSpec (type);
            SPEC_SCLS (etype) = (SPEC_SCLS (petype) == S_REGISTER ?
                                 SPEC_SCLS (etype) : SPEC_SCLS (petype));
+            if (IS_SPEC (type))
+              SPEC_CONST (type) |= SPEC_CONST (stype);
+            else
+              DCL_PTR_CONST (type) |= SPEC_CONST (stype);
            return type;
          }
        fields = fields->next;