Due to the integer promotion rules, an internal expression (i.e. before casting (UINT32) ) is considered as a signed int . Therefore, 0x1 << 31 is 0x80000000 , which is a negative integer, which leads to a warning. To fix, you can force the shifts to be unsigned by adding "U" to the hexadecimal constants, for example 0x1U .
regVal |= (UINT32)( (0x1U << 31) | (0x1U << 26) | 0x3EU);
This will cause all shifts and bitwise ORs to be unsigned, which should eliminate the warning (and also eliminate the need for a cast (UINT32) , since it is already unsigned).
Drew mcgowen
source share