Suspected c++ compiler bug in CodeWarrior for ColdFire V6.4

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Suspected c++ compiler bug in CodeWarrior for ColdFire V6.4

1,220件の閲覧回数
henryhei
Contributor I

I'm maintaining an old product based on MCF5208, I found some code behavior is strange, so I wrote a simple test code to do test. I think I found a compiler bug when using C++ virtual  function.

class A
{
public:
virtual int Size()=0;
};

class B:public A
{
public:
virtual int Size()
{
return 10;
}

};

static B b;


void test(void)
{
A *p = &b;
int x = b.Size();
int y= p->Size();
int z=x+y;
}

When code run to p->Size(); it will crash.

Capture_compile_error.jpg

I have decompiled the code and run it in step mode, I found it crashed in the line I marked red.

Is this a real problem or it just because of some incorrect compiler settings?

0 件の賞賛
返信
2 返答(返信)

819件の閲覧回数
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Henry,

CodeWarrior 6.4 is an old version and many bugs have been fixed since that version, have you tried using CodeWarrior 10.7 which is the newest version and see if the same problem is present?

CodeWarrior for Microcontrollers-Eclipse IDE|NXP 

Let me know the results!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 件の賞賛
返信

819件の閲覧回数
henryhei
Contributor I

Hi,

I have tried to use this new version, but as you know, the new eclipse based codewarrior can not translate the project file automatically, I spent more than three days to do this manually but failed.

For our legacy project, changing the compiler is impossible, the only thing I want to know is that whether it is a known issue.

And can you give me the bug list of Version 6.4, then we can avoid this type of problems. Because our product is a Safety product and has a SIL1 certification, our management are very worried about this problem.

Thanks.

0 件の賞賛
返信