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.

[参考译文] AM6421:有一个 GCC 属性不起作用。

Guru**** 2419530 points


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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1527592/am6421-there-is-a-gcc-attribute-can-not-work

器件型号:AM6421

工具/软件:

您好!

当我被测试主函数退出时,所有与析构函数相关的函数都没有运行。

GCC 属性是__attribute__(析构函数 (x))、其中 x 表示 API 优先级编号。

我的本地开发环境如下:

CCS 版本: 12.7.1.00001

SDK 版本:10.0.0.20

这样的示例代码、

#include "ti_drivers_open_close.h"
#include "ti_board_open_close.h"

static __attribute__((constructor(101))) void system_entry(void)
{
        System_init();
        Drivers_open();
}

static __attribute__((constructor(102))) void system_entry_2(void)
{
        Debug_LogP("Enter AM64 system.\n");
}

static __attribute__((destructor(101))) void system_exit(void)
{
        Drivers_close();
        System_deinit();
}

static __attribute__((destructor(102))) void system_exit_2(void)
{
        Debug_LogP("Exit AM64 system.\n");
}

当退出主函数时、 系统退出到退出函数和中止函数。

请检查此归属。

B.R.

Jaxon