大家好、
以下是客户提出的问题、可能需要您的帮助:
编译器版本:v15.12.3.LTS
例如、
int16 current = 495; float result = current * current; //current * current(=495025) will overflow, so the result will be incorrect
我知道使用力类型转换将使其正确:
float result = (float) current * (float) current;
但是、此客户端的代码从 Tricore 中移植(在该平台中、不会因其描述而溢出)、并且其中包含许多此类语句。 是否可以通过编译器设置自动实现转换?
我在 TMS320C28x 优化 C/C++编译器 v22.6.0.LTS 用户指南(修订版 y)。
谢谢、此致
耶鲁李