the.bay.news

There has got to be a better way to deal with bitfields in C

Ziggit
There has got to be a better way to deal with bitfields in C
I just encountered a problem involving this MacOS header file: typedef struct { natural_t pad1; mach_msg_size_t pad2; unsigned int pad3 : 24; mach_msg_descriptor_type_t type : 8; } mach_msg_type_descriptor_t; xnu_static_assert_struct_size(mach_msg_type_descriptor_t, 12); After translation, the code becomes: // /home/cleong/.zvm/0.16.0/lib/libc/include/any-darwin-any/mach/message.h:296:32: warning: struct demoted to opaque type - has bi...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.