title: C variable type assert
body: <pre><code>uint32_t fail_count = 0;
  
  ...
  
  if(is_failed)
      if(fail_count &lt; UINT32_MAX - 1 )
          ++fail_count;
  </code></pre>
  
  <p>It works fine, but this code is fragile. Tomorrow, I may change the type of <code>fail_count</code> from <code>uint32_t</code> to <code>int32_t</code> and I forget to update <code>UINT32_MAX</code>.</p>
  
  <p>Is there any way to assert <code>fail_count</code> is a <code>uint32_t</code> at the function where I have written my <code>if</code>s?</p>
  
  <p><strong>P.S. 1-</strong> I know it is easy in C++ but I'm looking for a C way.</p>
  
  <p><strong>P.S. 2-</strong> I prefer to use two asserts than relying on the compiler warnings. Checking the number size via <code>sizeof</code> should work but is there any way to distinguish if type is unsigned?</p>