I have a code which uses bit-fields declared as follows
typedef struct my{
const char *name;
uint8_t is_alpha : 1;
uint8_t is_hwaccel : 1;
As others have mentioned about portability issues et al, if you didn't know you can just disable the warning via the warning pragma:
https://docs.microsoft.com/en-us/cpp/preprocessor/warning?view=vs-2019
#pragma warning(push)
#pragma warning(disable: 4214) // warning C4214: nonstandard extension used: bit field types other than int
typedef struct my{
const char *name;
uint8_t is_alpha : 1;
uint8_t is_hwaccel : 1;
uint8_t x_chroma_shift;
uint8_t y_chroma_shift;
} mystr;
#pragma warning(pop)
Also you can disable specific warnings in your project properties but then they are project wide. This way you can control them per data type.
Then if you are ever not sure 100% what kind of binary code MSVC will generate for these either run it in the debugger and look at the "disassembly view" (break on where it gets accessed), or load up your executable (with PDB file for symbols) in a disassembler like IDA Pro, Ghidra, etc.