I’ve a question regarding the following code:
#include "all_needed.h"
static uint8_t array[2] = {0};
void main(void)
{
...
}
Is a (module) global array allowed to be initialized as above for having each member set to zero while being ANSI C conform?
I’ve got a problem in Code Composer 5 (MSP430 Project) where I had to change it into
static uint8_t array[2] = {0, 0};
for a correct initialization of the 2nd member of the array.
Yes, this is allowed, and should initialize the array to zero. C99, §6.7.8 p10:
and p21:
Report the bug to your compiler vendor.