This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: aliasing nastiness
- To: mindbender at lokigames dot com
- Subject: Re: aliasing nastiness
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Fri, 14 Jan 2000 22:45:14 +0100
- CC: gcc at gcc dot gnu dot org
- References: <387F78A7.E3B0BFFB@lokigames.com>
> My question is : is there any way to make the value that gets
> stored into tmp identical across both platforms?
>
> double FillDouble( char * buffer )
> {
> double tmp = *(double*)buffer;
>
> return tmp;
> }
If you provide the same bytes in buffer on Linux/x86 and Win9x, you
should get the same values. If you use Linux/Sparc, you'll get a
different value due to endianness.
Regards,
Martin