Hello,
I have added U postfix to the integer but the problem still is the same.
I read following pages but didn't work. http://www.keil.com/support/docs/3243.htm http://www.keil.com/forum/14703/
#define M(x) (u32)(1U << (x%32)) enum{ eFirst = M(x) ..... eLast = M(31) // generate "integer operation result is out of range" }
Can I avoid this warning?
You should be able to cast it as an int to get rid of the warning.
(int)(1U << 31)
You'll want to make sure that it's actually doing what you want though.
I try to use unsigned 32bits in enum,
it is not possible?
In C, the type of an enumerator is int.
In C++, the type of an enumerator is its enumeration.
View all questions in Keil forum