Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Shift Count is too Large (shift-left) on CCE v3

Even though itd the wrong place, but your someChar is probably a char = 8bit. Doing a 16bit shift is definitely wrong. Also, make sure, not to shift signed values, where you can get strange results. So either use an unsigned char or check, if the compiler is using unsigned char if for something like

'char c;'

Correct would be something like:
unsigned char sampleChar[MAX];
unsigned long ul = (((unsigned long)sampleChar[0])  << 16) & 0xff000000;


unsigned long ul = sampleChar;
ul = (ul << 16) & 0xff000000;

Josuel Padua schrieb:
Sorry if this is the wrong place for this question, but has anyone tried shift-lefts on CCE v3? I am getting"Shift Count is too Large" warnings when I try to shift a byte 16 or more bits to the left and the CCE seem to not execute the shift. Any idea why this is happening? ex. *longint = (**sampleChar[0] << 16 & 0xFF0000)*, where longint is a variable of type unsigned long int, produces the warning I stated. Thanks.


cdt-dev mailing list

Back to the top