title: warning: address of local variable 'angles' returned [-Wreturn-local-addr]
body: <p>I'm trying to return float x, y and z angle values for a body object from my ODE (open dynamics engine) simulation.</p>
  
  <pre><code>float* Creature::eulerAngles(const float &amp;q0, const float &amp;q1, const float &amp;q2, const float &amp;q3){
  
      float angles[3] = {atan2(2 * (q0*q1 + q2*q3), 1 - 2 * (q1*q1 + q2*q2)),
                        asin( 2 * (q0*q2 - q3*q1)),
                        atan2(2 * (q0*q3 + q1*q2), 1 - 2 * (q2*q2 + q3*q3))};
      return angles;
  }
  </code></pre>
  
  <p>Because <code>dBodyGetQuaternion</code> returns 4 const float quaternions I need to then get the rotations and I've had immense difficulty trying to get it to compile. Now it does compile but I'm getting this warning.</p>
  
  <p>Could anyone explain to me why and what it means please?</p>