Possible bug in the switch statement for Coldfire V1

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

Possible bug in the switch statement for Coldfire V1

Jump to solution
686 Views
gustavod
Contributor III

Hi everyone,

 

We are facing a lot of problems with switch statement for coldfire V1 in the CodeWarrior 6.3 IDE.If we use a unsigned char (INT8U in our code) variable for "if" and "while" statements the compiler works well. However, for "switchs" the compiler makes the test with long (32 bits), not for unsigned char (8 bits). If there are some trash in the used register, the test fails.

 

I'm attaching  a sequence of images that show this behavior.

 

Is there any workaround for this compiler bug? This is very annoying, since a lot of code from other people (like FATFS) makes use of switch statements for unsigned char variables.

 

I'm also attaching the source code. The problem occurs in the SD_API.c file, in the function:

INT8U file_name_verify(INT8U *pname1,INT8U *pname2, INT8U *pfile, INT8U num)

 

The problem could be seen in the disassembly of this file.

 

Thanks in advance,

Regards,

Gustavo

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
449 Views
kef
Specialist I

You should submit srvice request here

View solution in original post

0 Kudos
Reply
2 Replies
450 Views
kef
Specialist I

You should submit srvice request here

0 Kudos
Reply
449 Views
gustavod
Contributor III

and the source code.

0 Kudos
Reply