我试图将一些旧的代码从一个20岁的DOS系统移植到GNU Linux系统.在他们的几个头文件中(包含在整个地方),它们具有它们声明和初始化的结构体的结构.当我编写遗留代码的方式编译时,我收到警告.有关如何使其保持在同一个头文件中的任何提示?
以下是我对其所做的简化示例.
struct A
{
struct B temp1;
struct C temp2;
};
struct B
{
int temp3;
int temp4;
int temp5;
};
struct C
{
int temp6;
int temp7;
int temp8;
};
//These are the variables in how they are related to the initialization below
//struct A test_one = {{temp3,temp4,temp5},{temp6,temp7,temp8}};
struct A test_one = {{1,2,3},{4,5,6}};
Run Code Online (Sandbox Code Playgroud)