This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C6000整形扩展问题



您好,我使用C674x ,CCS5 , C语言 ,在整形扩展时出现问题

//unsigned

u8 = u16 = u32 = 1;

//signed
s8 = s16 = s32 = -1;

执行大于小于运算出现以下错误结果,且错误的结果都是产生在 num 与 32位数比较时发生问题,还没有测试40位数或64位数 

u32<s8
s8>u32
u32<s16
s16>u32
u32<s32
s32>u32

当把signed 扩展到 long  时,可避免错误发生,我知道各种平台在整形扩展时都存在不同问题,想请教在C6000平台上如何避免这个错误结果?

谢谢