In file included from main.c:3:
sub.h:1:16: warning: ‘struct test’ declared inside parameter list will not be visible outside of this definition or declaration
1 | int sub(struct test *ts);
| ^~~~
main.c: In function ‘main’:
main.c:27:21: warning: passing argument 1 of ‘sub’ from incompatible pointer type [-Wincompatible-pointer-types]
27 | printf("%i\n", sub(ts));
| ^~
| |
| struct test *
In file included from main.c:3:
sub.h:1:22: note: expected ‘struct test *’ but argument is of type ‘struct test *’
1 | int sub(struct test *ts);
| ~~~~~~~~~~~~~^~
sub.c:3:16: warning: ‘struct test’ declared inside parameter list will not be visible outside of this definition or declaration
3 | int sub(struct test *ts)
| ^~~~
sub.c: In function ‘sub’:
sub.c:5:11: error: dereferencing pointer to incomplete type ‘struct test’
5 | return ts->x - ts->y - (*ts->p);
| ^~
Partager