title: warning: integer constant is too large for "long" type
body: <p>I have the following code.</p>
  
  <pre><code>  uint32_t reg_val = 0;
    uint64_t val = 0;
    reg_val = 0;
    reg_val = ((val &amp; 0xffffff000000) &gt;&gt; 24);
    dev_write(rw,reg_val);
  </code></pre>
  
  <p>The compiler gives a warning that says</p>
  
  <pre><code>warning: integer constant is too large for "long" type
  </code></pre>
  
  <p>I am only assigning 24 bits to reg_val which is define to be unsigned integer of size 32bits.</p>
  
  <p>Why is the compiler generating this warning?</p>