When initializing a global array as follows:
uint32_t test[32] = { 0 };
I would expect all elements to be initialized to 0. However, only the first one becomes 0. Is this a bug, or a misunderstanding from my side?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
When initializing a global array as follows:
uint32_t test[32] = { 0 };
I would expect all elements to be initialized to 0. However, only the first one becomes 0. Is this a bug, or a misunderstanding from my side?
Thank you, but it does not give me a solution for C. According to K&R C, "the trailing members are initialized with 0" for a brace-enclosed list of initializers for an array. Is this a bug?
I thought I fixed the problem with the following entry in my linker file:
.ebss : FILL = 0x00 > RAML1 PAGE = 1
However, I recently discovered that some global structs were not zero-initialized (even though they were assigned { 0 }). Where did I miss?