Anonymous Structures in C found in Unix Kernel

倖福魔咒の 提交于 2019-12-04 03:06:44

IIRC, ancient C compilers kept all field names (such as integ) in a single namespace instead of creating a namespace per struct type. They also did not distinguish between struct pointers and int pointers, so that every pointer has an integ field corresponding to its first sizeof(int) bytes. Since integ is the first value in a struct and has type int, SW->integ corresponds to *((int *)SW).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!