"Unsigned / int mixup (?)"

This is a discussion on "Unsigned / int mixup (?)" within the C Programming forums, part of the General Programming Boards category; Hello.
In a struct:
Code:
<...>
unsigned upper : 4;
<...>
The above 'upper' field is populated by a int ...

I'm not sure what your question is. You should use unsigned int types for your bit fields. If you try to assign a bigger value, they will just be truncated. If you try to fit 16 in there, you should end up with 0 because unsigned overflow's behavior is defined in C.