title: Initializing bit-fields
body: <p>When you write</p>
  
  <pre><code>struct {
      unsigned a:3, b:2;
  } x = {10, 11};
  </code></pre>
  
  <p>is <code>x.b</code> guaranteed to be <code>3</code> by ANSI C (C89)? I have read and reread the standard, but can't seem to find exactly that case.</p>
  
  <p>For example, "result that cannot be represented by the
  resulting unsigned integer type is reduced modulo the number that is
  one greater than the largest value that can be represented by the
  resulting unsigned integer type." speaks about computation, not about initialization. And moreover, bit-field is not really a type.</p>
  
  <p>Also, (when speaking about unsigned t:4) "contains values in the range [0,15]", but it doesn't necessarily mean that initializer must be <em>reduced modulo 16</em> to be mapped to [0,15].</p>
  
  <p>Struct initialization is really painstakingly detailedly described, but I really can't seem to find exactly that behavior. (Of course compilers do exactly that. And IBM documentation says " when you assign a value that is out of range to a bit field, the low-order bit pattern is preserved and the appropriate bits are assigned.", but I'd like to know if ANSI C standardizes that.</p>