This is the mail archive of the gcc-patches@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: [PATCH] Use HOST_WIDE_INTs in gcd and least_common_multiple.


>> How about:
>>
>> HOST_WIDE_INT
>> mul_hwi (HOST_WIDE_INT x, HOST_WIDE_INT y)
>> {
>> Â HOST_WIDE_INT r = x * y;
>
> At this point, undefined behavior may have occurred.

Well, then:

HOST_WIDE_INT r = (unsigned HOST_WIDE_INT) x * (unsigned HOST_WIDE_INT) y;

Jay.


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