>> complains about the following statement: >> ---- >> result = *(float*)&resultAsUnsigned;
No, this compiler warning message does not indicate a bug in the code. "resultAsUnsigned" is a 4-byte value that stores a 'float'; it is not an unsigned value that gets converted to a float. >> This little snippet, and it's compiled output, illustrate the problem: No, a more accurate 'snippet', which illustrates what the code really does, would be: void func(float &f) { float val = 3.0; unsigned *vptr = (unsigned*)&val; unsigned resultAsUnsigned = *vptr; // a 4-byte value that stores a 'float' f = *(float*)&resultAsUnsigned; } (and then "main()" as you originally wrote it) If you can suggest an alternative coding that eliminates your compiler warning, then that would be great. But the code - as it stands - is not in error. Ross Finlayson Live Networks, Inc. http://www.live555.com/
_______________________________________________ live-devel mailing list live-devel@lists.live555.com http://lists.live555.com/mailman/listinfo/live-devel