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.

TMS320F2800154-Q1: 数据类型转换

Part Number: TMS320F2800154-Q1

你好:

在代码中,如果涉及到 有符号数据类型和 无符号数据类型的转换,

比如 int16_t a = -32;

uint16_t b = 16;

a/b = ?

在使用NXP S32ds开发环境时,即使不对数据作显式的数据转换,也可以得到正确的结果-2

但是在CCS中,如果不对计算作显式的数据类型转换,就会得到错误的结果4094

我想请问的是,CCS的编译器会不会自动对数据进行数据类型转换?

  • 您好

    CCS 编译器不会自动对于数据进行数据转换,而且您给的定义也存在问题,所以报错是正常情况。请修改您代码解决这个问题。