title: Dangerous conversion from int to longlong: No warning?
body: <pre><code>UINT One = 1;
  LONG     mylong      = LONG(-1) * One;
  LONGLONG mylonglong1 = LONG(-1) * One;
  LONGLONG mylonglong2 = LONG(LONG(-1) * One);
  </code></pre>
  
  <p>What would be the value stored in <code>mylong</code>, <code>mylonglong1</code> and <code>mylonglong2</code> ?</p>
  
  <pre><code>mylong      = 0xffffffff         (ok)
  mylonglong1 = 0x00000000ffffffff (why?)
  mylonglong2 = 0xffffffffffffffff (ok)
  </code></pre>
  
  <p>I was really surprised to know the result of <code>mylonglong1</code>, and more surprised that there is no compilation warning.</p>
  
  <p>Why assigning a LONG to a LONGLONG is causing that left padding with zeros?</p>
  
  <hr>
  
  <p>What really happened in a project is a problem in using the function CFile::Seek()</p>
  
  <pre><code>virtual LONG Seek( LONG lOff, UINT nFrom );
  </code></pre>
  
  <p>defined here: <a href="https://msdn.microsoft.com/en-us/library/aa270542(v=vs.60).aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/aa270542(v=vs.60).aspx</a>
  migrated to</p>
  
  <pre><code>virtual ULONGLONG Seek( LONGLONG lOff, UINT nFrom);
  </code></pre>
  
  <p>defined here <a href="https://msdn.microsoft.com/library/b2eb5757-d499-4e67-b044-dd7d1abaa0f8.aspx#cfile__seek" rel="nofollow noreferrer">https://msdn.microsoft.com/library/b2eb5757-d499-4e67-b044-dd7d1abaa0f8.aspx#cfile__seek</a></p>
  
  <p>After migration it no longer worked because the argument conversion of <code>lOff</code> was not giving the expected result.</p>