linux sysinfo结构体,编译BusyBox出现错误: struct sysinfo 重定义 该如何解决?

Busybox 1.13.3和其他的1.16版本都是如此     arm-linux-gcc  version=4.3.3

===========================================================================================================

networking/slattach.c:232:13: 警告: 提领类型双关的指针将破坏强重叠规则 [-Wstrict-aliasing]

networking/slattach.c:241:9: 警告: 忽略声明有 warn_unused_result 属性的‘system’的返回值 [-Wunused-result]

CC      networking/tcpudp.o

In file included from /usr/include/linux/sysctl.h:25:0,

from /usr/include/linux/netfilter.h:6,

from /usr/include/linux/netfilter_ipv4.h:8,

from networking/tcpudp.c:35:

/usr/include/linux/kernel.h:12:8: 错误: ‘struct sysinfo’重定义

include/libbb.h:94:8: 附注: 原先在这里定义

networking/tcpudp.c: 在函数‘xsetenv_plain’中:

networking/tcpudp.c:72:3: 警告: 提领类型双关的指针将破坏强重叠规则 [-Wstrict-aliasing]

networking/tcpudp.c: 在函数‘xsetenv_proto’中:

............

...........

networking/tcpudp.c:452:7: 警告: 提领类型双关的指针将破坏强重叠规则 [-Wstrict-aliasing]

networking/tcpudp.c:454:8: 警告: 提领类型双关的指针将破坏强重叠规则 [-Wstrict-aliasing]

networking/tcpudp.c:457:6: 警告: 提领类型双关的指针将破坏强重叠规则 [-Wstrict-aliasing]

networking/tcpudp.c:457:20: 警告: 提领类型双关的指针将破坏强重叠规则 [-Wstrict-aliasing]

networking/tcpudp.c:489:8: 警告: 提领类型双关的指针将破坏强重叠规则 [-Wstrict-aliasing]

networking/tcpudp.c:490:42: 警告: 提领类型双关的指针将破坏强重叠规则 [-Wstrict-aliasing]

make[1]: *** [networking/tcpudp.o] 错误 1

make: *** [networking] 错误 2

====================================================================================

于是我直接进入include/ 然后 vim libbb.h  看到里面的在Line 92中有一个struct info的定义,然后里面有说明:

90 /* Include our own copy of struct sysinfo to avoid binary compatibility

91  * problems with Linux 2.4, which changed things.  Grumble, grumble. */

看来,我认为直接注释掉就行了,因为我用的是Linux 2.6的内核

于是用

#if 0

#endif

完成对这段的注释,但是还是出错,说struct sysinfo仅仅是形参,该如何处理呢?

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值