This portion of code
typedef struct
{
unsigned int a : 1;
} bitfield_t;
bitfield_t bitfield = {1};
unsigned char c = bitfield.a;
when compiled with Visual Studio 2019 cl /TC /W4 main.c produces the warning 'initializing': conversion from 'unsigned int' to 'unsigned char', possible loss of data
I don't understand how there can be a loss of data when assigning from a 1-bit field to an 8-bit variable. Does the C standard not guarantee that this assignment be possible and have the expected value c == 1?