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.

[参考译文] CCSTUDIO:CCS 20.5.0 中的数据类型大小问题

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1638095/ccstudio-data-types-size-issue-in-ccs-20-5-0

部件号: CCSTUDIO

我正在为 TMS320F28P65x 使用 CCS 20.5.0、并希望使用 stdint.h 中的 uint16_t 但它是否定义为“typedef unsigned short uint16_t “、当在 sizeof () 中进行检查时、得到 2、而不是“TMS320C28x 优化 C/C++编译器 v21.6.0.LTS 用户指南“中指定的 1。 我检查了 sizeof (char)、sizeof (short)、sizeof (int)、sizeof (long)、它们分别产生了 1、2、4 和 4、这与上述用户指南中提到的 char、short 和 int 为 16 位宽、long 为 32 位宽。

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

    尊敬的 Mahesh:

    我在我的设置上检查了数据类型的大小、我得到了以下结果。

    sizeof (char)= 1
    sizeof (short)= 1
    sizeof (int)= 1
    sizeof (long)= 2
    sizeof (uint16_t)= 1

    我使用 CCS 20.5。 和 v25.11.0 LTS