Re: GCC casts short to int

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John (Eljay) Love-Jensen wrote:
> Hi Leonitis,
> 
>> How can I instruct GCC (in the code) to do this?
> 
> The production is:
> 
> (short) * (short) ==> (int)
> 
> If you want that to be a short:
> 
> (short)((short) * (short)) ==> (short)
> 
> So try this:
> 
> c += (short)(a * b);

It's still an integer overflow.

Andrew.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux