From 855fb20becd989504cef449dd60983ff5958a2af Mon Sep 17 00:00:00 2001 From: epetrich Date: Thu, 18 Sep 2003 15:00:43 +0000 Subject: [PATCH] * src/SDCCsymt.c (structElemType): fixed bug #808291 (members 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 | 5 +++++ src/SDCCsymt.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5c211d47..5bc2d441 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-09-18 Erik Petrich + + * src/SDCCsymt.c (structElemType): fixed bug #808291 (members + of const struct should be treated as if const themselves) + 2003-09-18 Bernhard Held * src/SDCCval.c (valPlus, valMinus): fixed bug #808337 diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 5f538398..48a558fd 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -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; -- 2.47.2