Hardware 版 (精华区)
发信人: edmcgy (达达尼), 信区: Hardware
标 题: DSP(Data Signal Processor)的应用(7)
发信站: 紫 丁 香 (Thu Apr 23 15:27:09 1998), 转信
Workaround/Solution
WORKAROUND/SOLUTION
===================
Use construct in larger expression or make dummy assignment:
i.e.
if (ptr->mos > 0);
dummy = vptr->mos;
Title: As requested find attached listings for both the working 'C' ...
Bug #
Tool
Version
Fixed?
SDSsq02023
Compiler
V6.60
Fixed, will appear in next release.
Bug Description
BUG DESCRIPTION
===============
When a nested structure is not the first element within
a structure definition, the optimizer may inadvertently
calculate incorrect offset for the nested structure
members.
i.e.
typedef struct
{ int mem1, mem2; } LEVEL2
typedef struct
{ int mem3, mem4, mem5;
LEVEL2 nest;
} LEVEL1 ;
void func(void)
{ LEVEL1 *p= (LEVEL1 *) 10000;
p->nest.mem1 = 1000; <====== Incorrect code generated p->nest.mem2 = 2000; <====== to access these members
--
※ 来源:.紫 丁 香 bbs.hit.edu.cn.[FROM: edmcgy.hit.edu.c]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.008毫秒