Смотри:
sysop@pc:~$ gcc -Wall -Wextra -std=c89 -pedantic testcl.c
testcl.c: In function 'main':
testcl.c:15:21: warning: ISO C90 forbids compound literals [-Wpedantic]
return f((struct s){ 2, 3});
^
sysop@pc:~$ gcc -Wall -Wextra -std=c90 -pedantic testcl.c
testcl.c: In function 'main':
testcl.c:15:21: warning: ISO C90 forbids compound literals [-Wpedantic]
return f((struct s){ 2, 3});
^
sysop@pc:~$ gcc -Wall -Wextra -std=c99 -pedantic testcl.c
struct s {
int a;
int b;
};
int f(struct s v)
{
return v.a*v.b;
}
int main()
{
return f((struct s){ 2, 3});
}