Possible bug in the switch statement for Coldfire V1

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

Possible bug in the switch statement for Coldfire V1

ソリューションへジャンプ
1,096件の閲覧回数
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

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
859件の閲覧回数
kef
Specialist I

You should submit srvice request here

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
860件の閲覧回数
kef
Specialist I

You should submit srvice request here

0 件の賞賛
返信
859件の閲覧回数
gustavod
Contributor III

and the source code.

0 件の賞賛
返信