Melchior FRANZ wrote:

* Melchior FRANZ -- Friday 02 December 2005 01:43:
But ... we weren't really returning the address of an auto var.

Is it a gcc 4.0.2 (SuSE 10.0) compiler bug? tiny_xdr.cxx contains
this function;

 float
 XDR_decode_float ( const xdr_data_t & f_Val )
 {
     float* tmp;
     xdr_data_t dummy;

     dummy = XDR_decode_int32 (f_Val);
     tmp = (float*) &dummy;
     return (*tmp);
 }


Here you are just returning the contents of a memory location, not the pointer itself (aka a value). So this should be perfectly safe. My bet is that the value didn't get decoded properly, but whatever got decoded incorrectly was returned correctly. I'd check the value if (*tmp) before it get's returned to see if it looks like what you think it should.

I'll bail out here before I get to the x86 assembler portion of your message. :-)

Curt.

--
Curtis Olson        http://www.flightgear.org/~curt
HumanFIRST Program  http://www.humanfirst.umn.edu/
FlightGear Project  http://www.flightgear.org
Unique text:        2f585eeea02e2c79d7b1d8c4963bae2d


_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to