This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

#64-D shift count is too large



Hi all,

I am trying to compile my program and getting this warning. I added my code below to explain what i am doing.

h2Obj.hwConfig.wLen = SPI_WORD_LENGTH_16;

/* Set Wordlength bit 0,1,2......31 */
spicmd2 = h2Obj.hwConfig.wLen << CSL_SPI_SPICMD2_CLEN_SHIFT;

CSL_FSET(CSL_SPI_REGS->SPICMD2, 15, 0, spicmd2); ***** I get the warning for this line

I have to change SPI configuration inside my code. At first, I tried the above code and it was working despite of the warning. However, when I add this code part to four points inside my code, there are still warnings and my code jumps at the end of my code.

Any idea or recommendation is appreciated.

Thanks in advance.

  • The result of a shift is undefined if the right operand is >= the number of bits in the left expression's type.  In this case, that invocation of CSL_FSET probably expands to a shift by a constant which violates that requirement.  It is likely that one of the operands to CSL_FSET is incorrect.  Some constant is wrong, or the type of a non-constant is wrong.

    Thanks and regards,

    -George