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.

[参考译文] 编译器/TMS570LS1227:使用–o2和–o3编译器不会生成构造函数调用(结构未正确初始化)

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/746131/compiler-tms570ls1227-using-o2-and-o3-compiler-does-not-generate-constructor-calls-struct-is-not-initialized-correctly

器件型号:TMS570LS1227

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

您好!

我正在使用 CGT v5.2.9。

是否有人可以告知相关 SDSCM00040934中所述问题的范围。

它是否仅限于 C++和构造函数调用生成、或者我是否需要考虑在 C 结构初始化(基于闪存和 RAM 的初始化中的常量)中使用链接器定义的符号?

此致、Tony

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

    [引用用户="Tony Morrell"]是否仅限于 C++[/引用]

    我找不到一种方法来使错误在 C 中发生

    此论坛主题 是有关该问题的原始报告。  该线程中的测试用例位于 C++中。  关键线是...

    信息2 ((unsigned)_end_isr_stack -(unsigned)_start_isr_stack); 

    在 C 语言中可以写类似的东西...

    struct Info Info2 ={(unsigned)_end_isr_stack -(unsigned)_start_isr_stack}; 

    但这不是合法的 C 语言。 在 C 语言中、此类初始化仅限于编译时间常数表达式。

    谢谢、此致、

    乔治