title: Understanding integer sum in C
body: <p>I'm trying to formally understand how additive operators work from the Standard's formal standpoint. There are 2 bullets:</p>
  <blockquote>
  <p>4 If both operands have arithmetic type, the usual arithmetic
  conversions are performed on them.</p>
  <p>5 The result of the binary +
  operator is the sum of the operands.</p>
  </blockquote>
  <p>Considering the following piece of code</p>
  <pre><code>unsigned int m = UINT_MAX;
  printf(&quot;%d\n&quot;, m + 1);
  </code></pre>
  <p>we have that <code>UINT_MAX + 1</code> does not fit the width of <code>unsigned int</code> so to represent the result <code>unsigned int</code> is not enough. So I found a section describing unsigned integers conversions:</p>
  <blockquote>
  <p>if the new type is unsigned, the value is converted by repeatedly
  adding or subtracting one more than the maximum value that can be
  represented in the new type until the value is in the range of the new
  type.</p>
  </blockquote>
  <p>The new type here is <code>unsigned int</code>, but the problem is <strong>what is the old type then</strong>? It cannot be <code>unsigned int</code> since the resulting value cannot be represented due to the width of <code>unsigned int</code> is too small.</p>