【发布时间】:2010-12-20 15:16:51
【问题描述】:
我正在尝试将一些旧代码从 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}};
【问题讨论】:
标签: c header struct initialization gnu