There is an optimizer problem here. You should try a more efficient syntax by casting the result of the shift back to (unsigned char), as the C standard rules are considering the result of any operator as at least an int. Forcing the shift result to a char will allow a direct char compare and the optimizer will not fail with the widening: if((unsigned char)((g_DaliPacket[DALI_ADDRESS_BYTE]&0b011111110)>>1)==g_MyDaliSettings.m_ShortAddress) And the resulting code will be more efficient.