Re: left shift count >= width of type with constant, compile-time expression

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

 



Hi Jim,

What happens if you try this:

#define CLKSRC_MASK(bits) ((((cycle_t)1)<<bits)-((cycle_t)1))

The way you had it, it was operating on an int, not on a cycle_t.  Hence,
integer overflow.

--Eljay


[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