Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不同编译器对位域的实现是不同的,十分不建议在关键头文件中使用位域! #918

Closed
ufbycd opened this issue Dec 15, 2024 · 2 comments

Comments

@ufbycd
Copy link

ufbycd commented Dec 15, 2024

在用Zig调用AWTK时遇到了zig不兼容位域的问题
后面查了下,原来是因为,C语言标准并没有规定位域的具体存储方式,不同的编译器有不同的实现。即位域的存储是非标准的,跨编译器使用会出现兼容性问题。

那主要的问题来了,AWTK的授权是LGPL,严格来说,商用情况下app只能动态链接awtk;有位域时,如果app的编译器跟库的编译器不同,则非常容易出现兼容性问题。

虽然大多数情况下,awtk库跟app都是使用相同的编译器。但严格来说,LGPL项目的主要头文件就不应该使用位域。

@xianjimli
Copy link
Member

改了,你更新试试。我在做GO绑定也遇到位域不兼容的问题,改了一部分。

@ufbycd
Copy link
Author

ufbycd commented Dec 16, 2024

试下,没有暂时没发现问题。这样zig就可以直接调用AWTK了,方便太多。

@ufbycd ufbycd closed this as completed Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants