这个编译器好像不支持大括号级联,
const app_para_audio_data_t app_para_audio_data_const[app_para_audio_data_size] =
{
//0
{
0x12345678,//int len;
},
};
这样的初始化就会报错
error: missing braces around initializer [-Werror=missing-braces]
{
^
../main/application/app_para_const/app_para_audio_data_const.c:15:2:
0x12345678,//int len;
{
},
}
../main/application/app_para_const/app_para_audio_data_const.c:12:1: error: missing braces around initializer [-Werror=missing-braces]
{
^
../main/application/app_para_const/app_para_audio_data_const.c:15:2:
0x12345678,//int len;
{
},
}
[已解决] 结构体数组初始化
-
- Posts: 786
- Joined: Wed Nov 14, 2018 8:45 am
Re: 结构体数组初始化
你 app_para_audio_data_t 定义是什么?你这是个数组。你试一下:
Code: Select all
{
{
.x = 0x12345678,
},
{
.x = 0x87654321,
},
};
Who is online
Users browsing this forum: Google [Bot] and 180 guests