title: g++ warn when double/float is converted to unsigned integer without using -Wconversion
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5553103/g-wall-not-warning-about-double-int-cast">g++ -Wall not warning about double-&gt; int cast</a>  </p>
  </blockquote>
  
  
  
  <p>Per the question <a href="https://stackoverflow.com/questions/10541200/casting-double-to-unsigned-int">here</a>, direct conversion from double/float to unsigned integer is not portable.  I found I had a few cases in my code where this happens and I would like to tell g++ to warn me if this occurs, but I can't find such an option.  Does anyone know if there is an option to do this?  </p>
  
  <p>Note:  I do see -Wconversion, but that also warns about all kinds of other conversions that I don't care about (like converting int to unsigned int, which is portable per the standard).</p>
  
  <p>Edit:  Here's a code example for which I would like to see a warning:</p>
  
  <pre><code>double dblNumber = -234;
  unsigned long uintNumber = dblNumber;
  </code></pre>
  
  <p>On one version of g++, this gives me an integer value of 0xFFFFFF16 (which is -234 in 2's complement) .  On another it gives me 0.  Clearly the code is ambiguous, which is why it is understandably not considered portable.  </p>