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.

[参考译文] CCS/RM46L852:MISRA C警告不正确?

Guru**** 2394295 points


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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/629347/ccs-rm46l852-incorrect-misra-c-warning

部件号:RM46L852

工具/软件:Code Composer Studio

您好,

我在CCS 7.1 中启用了MISRA C检查,但以下代码出现问题:

uINT16_t ctTest = 0U;

uINT16_t *ptrTest;

...

ptrTest =&ctTest;

最后一行给出以下MISRA警告:

#1393-D (MISRA-C:2004 10.1)如果表达式是复杂的,则整数类型的表达式的值不应隐式转换为不同的基础类型。

是否有人能够解释此行的错误或CCS中的错误?