Question for switch-case

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Question for switch-case

1,434 次查看
james-lee
NXP Employee
NXP Employee
Hello,
 
I have one issue, may be due to compiler. If I have more code inside a "switch-case", then the control does not jump to end of "switch-case" after executing a "case" statement. It goes to some execption. Would you give me some adivce?
 
Best regards,
James
标签 (1)
标记 (1)
0 项奖励
回复
1 回复

357 次查看
CompilerGuru
NXP Employee
NXP Employee
I think we very probable need a bit more details here.
Which core are you using?
Which compiler?
With optimizations?
Can you show a compilable sample showing the problem?
Maybe a disassemble listing with the code and a comment how you expect it to be.

With the given info so far: Case entries in C do not jump to the end, you have to have a break. A missing break is a a common mistake.

But in the end: we need more info :smileyhappy:


0 项奖励
回复