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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

704 Views
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 Kudos
2 Replies

303 Views
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 Kudos

303 Views
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 Kudos