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.

[参考译文] 编译器警告:整数转换导致截断

Guru**** 2577155 points
Other Parts Discussed in Thread: AWR6843, MMWAVEICBOOST, AWR6843ISK

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/997245/compiler-warnings-integer-conversion-resulted-in-truncation

主题中讨论的其他器件:AWR6843MMWAVEICBOOSTAWR6843ISK

已用 MCAL:01.04.01.00GA MCAL、用于 AWR6843器件
已用硬件:MMWAVEICBOOST 和 AWR6843ISK

 

在 CAN_MCan.c 中,存在以下代码(第243行及更多):

 

DEM_ReportErrorStatus (CAN_E_hardware_error、DEM_EVENT_STATUS_FAILED);

 

DEM_ReportErrorStatus 将 uint16保存为第一个参数、而 CAN_E_hardware_error 是设置为0xFFFFFFU 的 uint32。

编译器显示以下警告:

警告#70-D:整数转换导致截断