[已解决] 结构体数组初始化
Posted: Fri Jun 25, 2021 1:57 pm
这个编译器好像不支持大括号级联,
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;
{
},
}
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;
{
},
}