title: Is this "extra" casting needed?
body: <p>The situation:</p>
  
  <pre><code>typedef unsigned int u32;
  typedef unsigned char u8;
  
  const u8 *x;
  ...
  var = (u32)(*(const u32 *)x);
  </code></pre>
  
  <p>var is supposed to contain a DWORD sized value. What I know about the assignment statement above is that: </p>
  
  <ol>
  <li>x is first a pointer to a u8 sized
  value. </li>
  <li>x is then cast to point to a
  u32 sized value, so we have: (const
  u32 *)x. </li>
  <li>x is then de-referenced, in
  order to get at the 32-bit value
  that it is pointing to, so we have:
  *(const u32 *)x </li>
  <li>The data that is de-referenced is then cast to u32
  size.</li>
  </ol>
  
  <p>So finally, the question is: I thought that in #3 above, the de-referencing will say that the value that we get from it is of 32-bit size, so if this is the case, then why is there an extra cast (explicit?) to say that the de-referenced value is 32-bit? Wouldn't it be o.k to just do steps 1 to 3 above, and not have to do step 4? </p>
  
  <p>Thanks for clarifying!</p>