Here used, unused attribute with structure.
unused
According to GCC document:
unused : This attribute, atta
unused :
This attribute, atta
This attribute should be applied on a variable not struct definition. Changing it to
struct
void func2() { __attribute__ ((unused)) struct St s[1]; }
will do the job.