In GCC, I get the error "initializer element is not constant" for the second line of the following code:
uint8_t gBuffer[512 + 4]; uint8_t* gAlignedBuffer = (uint8_t*)(((uint32_t)gBuffer + 4) & 0xFFFFFFFCU);
However, if I change & 0xFFFFFFFCU to + 0xFFFFFFFCU, the code compiles normally:
uint8_t gBuffer[512 + 4]; uint8_t* gAlignedBuffer = (uint8_t*)(((uint32_t)gBuffer + 4) + 0xFFFFFFFCU);
Why is this?
Anguel
source share