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.

[参考译文] 编译器/TMS320F28.0049万:为什么C2000ware示例中的某些变量不需要声明,并且不包含头文件而不包含任何编译器错误?

Guru**** 2601555 points


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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/626923/compiler-tms320f280049-why-some-of-variables-in-c2000ware-example-don-t-need-declarations-and-no-header-files-is-included-without-any-compiler-error

部件号:TMS320F28.0049万

工具/软件:TI C/C++编译器

尊敬的专家:

意外发现了一个问题,这让我感到困惑。当我将 f2.8004万x_cputimervars.h添加到TMS320F28.0049万的演示项目文件中时,以下代码:

结构CPUTIIMER_VARS {

volatile结构cputimer_regs *RegsAddr;
UINT32 InterruptCount;
浮点CPUFreqInMHz;
浮点周期InUSec;
};


我发现  struct CPUTIME_regs *RegsAddr的变量 在使用前未声明,   并且f2.8004万x_cputimervars.h不包含任何其他头文件。 但是当我开始编译文件时,结果是“没问题”,“为什么?

 

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

    C语言特别允许您创建指向定义不可见的结构的指针。

    谢谢,此致,

    -George