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

Defining NDEBUG macro causes ffi.sizeof struct to return 0 #28

Closed
danielga opened this issue Jan 31, 2021 · 2 comments
Closed

Defining NDEBUG macro causes ffi.sizeof struct to return 0 #28

danielga opened this issue Jan 31, 2021 · 2 comments

Comments

@danielga
Copy link

Short background: remade the build system to work in conjuction with the rest of my system that builds Lua modules for a game. The build system for this game defines the macro NDEBUG for release builds.

While testing a build of this module with the NDEBUG macro, it was noticed that ffi.sizeof("struct something") was returning 0 (with this struct definition being struct something { int value; };). It will correctly return 4 if this macro is not defined. The host is a Linux x86_64 machine and it was built using GCC 9 (version doesn't matter).

I don't know if you will want to fix this issue but I'll use it as a heads-up for the future.

@q66 q66 closed this as completed in c1e0c49 Jan 31, 2021
@q66
Copy link
Owner

q66 commented Jan 31, 2021

oops, definitely a bug :P thanks for reporting though

@danielga
Copy link
Author

Thanks a lot!

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