The correct and portable solution is to not use uint32_t, but to use uint8_t, and construct the integers manually.
At least that would be a failure at compile-time, rather than run-time.
And yes, it's a compile-time failure, which is great. My comment should not be read as criticism at all (though I would likely use `uint16_t`, as the OP says the code is intended to work with [presumably aligned] 16-bit words).