Re: shift-count-overflow possible issue on 64bit type

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

 



On Mon, 25 Nov 2019 at 12:18, Florian Weimer wrote:
>
> * Jonathan Wakely:
>
> > Why do you expect a different result for these?
> >
> > A small = 1 << 40;
> > B big = 1 << 40;
> >
> > In both cases the expression is 1 << 40, the type of A or B is irrelevant.
>
> Some languages define integer literals in such a way that they have
> types which do not exist at run time and evaluate constant expressions
> with infinite precision.

Yes, but C and C++ do not do that. Understanding the language you're
programming in is important.



[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