title: Are enums as bitfields implementation-defined types?
body: <p>I'm trying to better understand the C99 standard but now I'm confused about using enums as bitfields in structs and if they are treated as int or as implementation-defined type. When looking up in the final draft for C99, I found 6.7.2.1 para. 4</p>
  
  <blockquote>
    <p>A bit-field shall have a type that is a qualified or unqualified version of  <strong>_Bool</strong>, <strong>signed int</strong>, <strong>unsigned int</strong>, or some other implementation-defined type.</p>
  </blockquote>
  
  <p>and 6.7.2.2 para. 4</p>
  
  <blockquote>
    <p>Each enumerated type shall be compatible with <strong>char</strong>, a signed integer type, or an unsigned integer type. The choice of type is implementation-defined, but shall be capable of representing the values of all the members of the enumeration. ...</p>
  </blockquote>
  
  <p>So I tried with this simple source code</p>
  
  <pre><code>enum e {
      E0, E1
  };
  
  struct s {
      enum e bitfield : 4;
  };
  </code></pre>
  
  <p>I can compile this without warnings with gcc-5.0 and clang-3.5 using <code>-std=c99 -Wall -Wextra -pedantic</code> but I get the following warning with gcc-4.8</p>
  
  <pre><code>warning: type of bit-field 'bitfield' is a GCC extension
  </code></pre>
  
  <p>Here start the confusion. Are enums as bitfields treated as int or implemenation-defined type? Is this a bug in GCC-4.8 or did they change their interpretation of the standard? And is it safe to use this with other C99-compiler?</p>