title: Is it safe to compare an (uint32_t) with an hard-coded value?
body: <p>I need to do bitewise operations on 32bit integers (that indeed <a href="https://stackoverflow.com/a/7059314/2227298">represent chars</a>, but whatever).</p>
  
  <p>Is the following kind of code safe?</p>
  
  <pre><code>uint32_t input;
  input = ...;
  
  if(input &amp; 0x03000000) {
      output  = 0x40000000;
      output |= (input &amp; 0xFC000000) &gt;&gt; 2;
  </code></pre>
  
  <p>I mean, in the "if" statement, I am doing a bitwise operation on, on the left side, a uint32_t, and on the right side... I don't know!</p>
  
  <p>So do you know the type and size (by that I mean on how much bytes is it stored) of hard-coded "0x03000000" ?</p>
  
  <p>Is it possible that some systems consider 0x03000000 as an int and hence code it only on 2 bytes, which would be catastrophic?</p>