static uint32_t a[20] = {0};
and
uint32_t a[20] = {0};
I use both of them in the code
a[0] = 1;
and so on....
When I make the variable static
and use it I get an error
variable "a" was declared but never referenced
but when I remove static
things work fine.
In both the cases the array a
is a global one.
The error is with the MACROS .
Array declaration is done and it is used by some platform and I don't see an error on that. Same code provides an error because this declaration/array is not used on other platform.
My bad !!!!
static uint32_t a[20] = {0};
void func()
{
...............
#ifdef ABC
a[0] = 1;
#endif
................
}
Now compile on platform ABC no error compile on some non ABC platform there is an error.
Solution: Wrap global also under the respective macro
#ifdef ABC
static uint32_t a[20] = {0};
#endif