Hi,
as I understand it, since C99 it should be possible to initialise a structure to all zeros with "struct mystruct = {0}".
This appears to work within a function but not for a global variable with .cinit.
struct mystruct {
int a;
int b;
};
static struct mystruct gMyStruct = {0}; // this only seems to initialise the first element
void Init(void)
{
gMyStruct = (struct mystruct){0}; // this works and sets all elements to zero
}
I am using the TI v20.2.1.LTS compiler set to --c99 --
Why does it not work when intialising the global outside of a function.