title: Integer value corrupt when casting from void*
body: <p>I have the following code:</p>
  
  <pre><code>typedef void* EstimatedValue;
  
  EstimatedValue myFunction()
  {
      int myVal = 16;
      EstimatedValue value = &amp;myVal ;
      return value;
  }
  bool intLessOrEqual(EstimatedValue value1, EstimatedValue value2)
  {
      return *(int*)value1 &lt;= *(int*)value2;
  }
  </code></pre>
  
  <p>And this main function:</p>
  
  <pre><code>int x = 8;
  EstimatedValue val = myFunction();
  EstimatedValue x1 = &amp;x;
  intLessOrEqual(x1, val);
  </code></pre>
  
  <p>However, the value of the second argument (the one that is created in the function) is corrupt inside the <code>intLessOrEqual</code> function (the value is -858993460).
  If I try to access <code>*(int*)val</code> inside the <code>main</code> function it works ok. What could be the reason for this behavior? 
  What can be done in order to avoid this behavior</p>