Top "Bit-fields" questions

A bit field is used to compactly store multiple logical values as a short series of bits where each of the single bits can be addressed separately.

How to enforce the struct bit order with the GCC compiler?

I was wondering if there is a GCC C Compiler directive that allows me to determine the bit order for …

c gcc compiler-construction microcontroller bit-fields
Initializing bit-fields

When you write struct { unsigned a:3, b:2; } x = {10, 11}; is x.b guaranteed to be 3 by ANSI C (C89)? I have …

c struct initialization ansi bit-fields
Bit-fields of type other than int?

I have a code which uses bit-fields declared as follows typedef struct my{ const char *name; uint8_t is_alpha : 1; …

c visual-c++ bit-fields
Mapping bit-field structure to volatile register

I'm writing an application which interfaces with a number of registers that are defined in VHDL. The registers are 32-bits …

c embedded bit-fields
How slow are bit fields in C++

I have a C++ application that includes a number of structures with manually controlled bit fields, something like #define FLAG1 0…

c++ bit-fields
Which end of a bit field is the most significant bit?

I'm writing a C++ application for Windows XP/Vista/7 using Visual Studio 2008. Some of my structures use a bit field, …

c windows visual-studio-2008 bit-fields
Go: Bitfields and bit packing

The C language's bitfields provide a fairly convenient method of defining arbitrary-width fields within a structure (nevermind the problems with …

go bit-fields
Comparing Bitfields of Different Sizes

What happens if you use a bitwise operator (&, |, etc.) to compare two bitfields of different sizes? For example, comparing 0 1 1 0 …

c++ bit-manipulation low-level bit-fields