This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Strange conversion to int64


Tony Bernardin <sarusama@gmail.com> writes:

> Hey, I'm having a little trouble understanding the conversion gcc is
> doing in a statement with the following types:

This question is not appropriate for the mailing list gcc@gcc.gnu.org,
which is for gcc developers.  It would be appropriate for
gcc-help@gcc.gnu.org.  Please take any followups to gcc-help.  Thanks.


> int64 = int32 * uint32

According to the rules of the C++ language, this will convert the
int32 to uint32, do a uint32 multiplication producing a uint32 result,
and then zero extend the uint32 result to assign it to int64.  This
seems consistent with the output you reported.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]