title: warning: left shift count >= width of type
body: <p>I'm very new to dealing with bits and have got stuck on the following warning when compiling:</p>
  
  <blockquote>
  <pre><code> 7: warning: left shift count &gt;= width of type
  </code></pre>
  </blockquote>
  
  <p>My line 7 looks like this</p>
  
  <pre><code>unsigned long int x = 1 &lt;&lt; 32;
  </code></pre>
  
  <p>This would make sense if the size of <code>long</code> on my system was 32 bits. However, <code>sizeof(long)</code> returns <code>8</code> and <code>CHAR_BIT</code> is defined as <code>8</code> suggesting that long should be 8x8 = 64 bits long.</p>
  
  <p>What am I missing here? Are <code>sizeof</code> and <code>CHAR_BIT</code> inaccurate or have I misunderstood something fundamental?</p>