CW10 - Switch Statement code generation, V1

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

CW10 - Switch Statement code generation, V1

跳至解决方案
794 次查看
WHookway
Contributor III

Hi,

I have a large switch statement and the generated code is using stack space (80 bytes), I cannot afford this, most of my threads call this routine.  I have organized the case values to be contiguous with no improvement, I do not know why the code is not a simple jump table at this point.  I noticed that others have posted this issue with previous versions of the compiler (CW8.1) and there was a pragma called switch_tables that allowed for control of how the case statement was implemented.  Is there a way to force the code generation of the switch statement?

Thanks,

Will

标签 (1)
标记 (1)
0 项奖励
1 解答
327 次查看
WHookway
Contributor III

Hi,

I appologize, I did not dig into this far enough.  The switch statement is building the table and the stack usage is due to another question that I will post, removing the switch statement had removed the stack usage.

Regards,

Will

在原帖中查看解决方案

0 项奖励
1 回复
328 次查看
WHookway
Contributor III

Hi,

I appologize, I did not dig into this far enough.  The switch statement is building the table and the stack usage is due to another question that I will post, removing the switch statement had removed the stack usage.

Regards,

Will

0 项奖励