Bit shifting fails with warning: left shift count >= width of type
It's basically an inability of the compiler to auto-promote the source variables to a size big enough to fit the shifted version.

The default type for all operations, unless otherwise specified, is 16-bit. By shifting more than 16 bits you are overflowing that default type.

To get around it you have to manually tell the compiler that you want to work with 32-bits:

#define SET_CMD_ID(ID)      ( ((uint32_t)ID) &lt;&lt; 27)
#define SET_CMD_CMD(CMD)    ( ((uint32_t)CMD)  &lt;&lt; 25)
#define SET_CMD_TYPE(TYPE)  ( ((uint32_t)TYPE) &lt;&lt; 19)
#define SET_CMD_PKT(PKT)    ( ((uint32_t)PKT)    )