test.c:
struct Foo{
char a[32]; // 32 and above will produce warning, but 31 and below will not
char d[9]; // 9 and above will produce warning, but 8 and below will not
};
int main()
{
struct Foo foo = {0};
(void)(foo);
return 0;
}
compile command and warning:
$ arm-eabi-gcc -Wstack-protector -fstack-protector-all -fstack-check -o test test.c
test.c: In function ‘main’:
test.c:6:5: warning: stack protector not protecting local variables: variable length buffer [-Wstack-protector]
int main()
^~~~
The struct in my source is something like Foo
in the source shown above, it can not be changed, therefore what can i do with the main function to solve the warning?
Any help would be much appreciated!