Cause

The error “array initialization needs curly braces” occurs when the target compiler allows array initialization without braces, but the host compiler requires curly braces for proper syntax.

Example

#include <stdio.h>
#include <stdint.h>
typedef uint32_t SeedType;
static SeedType applSeed[3] = 0u;
int main(void)
{
printf("%u %u %u\n", applSeed[0], applSeed[1], applSeed[2]);
return 0;
}

The line static SeedType applSeed[3] = 0u; initializes the array without using braces. While this may work on the target compiler, the host compiler raises an error as this syntax is not compliant with its rules. Modify this code to static SeedType applSeed[3] = { 0u }; and re-analyze and proceed with testing.

Need more help with this?
Don’t hesitate to contact us here.

Thanks for your feedback.