Document:WG14 N1186
Date: 2006-08-29
Author: Fred J. Tydeman

Possible Defect Report: "Plain" int bit-fields.

Consider the code:

int main(void){

struct bits {
  unsigned int uibf : 3; /* OK */
    signed int sibf : 3; /* OK */
 /*plain*/ int pibf : 3; /* ??? */
         _Bool bobf : 3; /* OK */
} bits;

  return 0;

Question: Are "plain" int bit-fields valid? Structure and union specifiers, paragraph 4 has:

A bit-field shall have a type that is a qualified or unqualified version of _Bool, signed int, unsigned int, or some implementation-defined type.

[Missing from that list is "plain" int].

6.7.2 Type specifiers, paragraph 5 has:

Each of the comma-separated sets designates that same type, except that for bit-fields, it is implemetation-defined whether the specifier int designates the same type as signed int or the same type as unsigned int.

[So, other parts of C99 assume that "plain" int bit-fields are valid.]

Suggestion: Add int to, paragraph 4.