当前位置:网站首页>static_assert报错为什么?
static_assert报错为什么?
2022-08-09 09:20:00 【y_dd】
mac os静态编译报错,下面报错:
static_assert(offsetof(sockaddr_in, sin_family) == 0, “sin_family offset 0”);
static_assert(offsetof(sockaddr_in6, sin6_family) == 0, “sin6_family offset 0”);
其中两个定义如下:
struct sockaddr_in {
__uint8_t sin_len;
sa_family_t sin_family;
in_port_t sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
struct sockaddr_in6 {
__uint8_t sin6_len; /* length of this struct(sa_family_t) /
sa_family_t sin6_family; / AF_INET6 (sa_family_t) /
in_port_t sin6_port; / Transport layer port # (in_port_t) /
__uint32_t sin6_flowinfo; / IP6 flow information /
struct in6_addr sin6_addr; / IP6 address /
__uint32_t sin6_scope_id; / scope zone index */
};
边栏推荐
- 本体开发日记04-努力理解protege的某个方面
- MVCC multi-version concurrency control
- 谷歌地图时代结束,怎么看高清卫星影像地图?
- Redis Basics
- 接口测试的概念、目的、流程、测试方法有哪些?
- Consolidation of Questionnaire Questions and Answers
- 本体开发日记02-sparql简单查询
- canal工作原理及简单案例演示
- Domestic with Google earth software, see the download 19th level high-resolution satellite images so easy!
- The era of Google Maps is over, how to view high-definition satellite image maps?
猜你喜欢
随机推荐
【面试体系知识点总结】---JVM
本体开发日记05-努力理解SWRL(Built-Ins)
运行flutter项目时遇到的问题修改flutter为国内镜像
Difference: char* and char[]
关于链表的几道大厂面试题
MySQL锁
网络安全入门基础:IP地址
jfinal加载配置文件原理
div模拟textarea文本框,输入文字高度自适应,且实现字数统计和限制
通用的测试用例编写大全(登录测试/web测试等)
多维度LSTM(长短期记忆)神经网络预测未来存款余额走势
These 12 GIS software are better than the other
软件测试面试常见问题及答案(发散思维、接口、性能、概念、)
性能测试报告包括哪些内容?模板范文哪里找?看这里
Redis高可用
营养与健康(HIT2021秋)
中国打造国产“谷歌地球”清晰度吓人
QT sets the icon of the exe executable
What does the test plan include?What is the purpose and meaning?
性能测试的基本概念是什么?做好性能测试需要掌握哪些知识?