I can't find anywhere in the C standard where this is specified. For example, in
struct { signed int x:1; } foo;
is foo.x
an lvalue of type int
, or something else? It seems unnatural for it to be an lvalue of type int
since you cannot store any value of type int
in it, only 0 or -1, but I can't find any language that would assign it a different type. Of course, used in most expressions, it would get promoted to int
anyway, but the actual type makes a difference in C11 with _Generic
, and I can't find any language in the standard about how bitfields interact with _Generic
either.
I would suspect that this would depend on: