This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
64 bit assignment trouble on a 32 bit platform
- From: kum <a dot kumaresh at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 29 Oct 2007 15:05:32 +0530
- Subject: 64 bit assignment trouble on a 32 bit platform
hi,
UINT64 a64; // UINT64 has been typedefed as long long unsigned int
UINT32 a32, b32;
a32 = x; // some value
b32 = y; // some value
a64 = a32 * b32;
a64 += a32 + b32;
Is it necessary to type-cast both a32 and b32 to make above statements
to work as expected? Without casting, I find that addition works while
the multiplication does not. Is there a compiler option to make this
work without casting? I am using gcc 4.1.1 on an xscale platform.
Thanks,
kumaresh