#include <stdio.h> struct S { int S; }; int f(struct S *s) { return --s.S; } int main(void) { int i; struct S S = { 2 }; i = f(S); return 0; }
Standard input is empty
prog.c: In function ‘f’: prog.c:6:19: error: ‘s’ is a pointer; did you mean to use ‘->’? return --s.S; ^ -> prog.c: In function ‘main’: prog.c:11:15: error: incompatible type for argument 1 of ‘f’ i = f(S); ^ prog.c:5:9: note: expected ‘struct S *’ but argument is of type ‘struct S’ int f(struct S *s) { ^ prog.c: In function ‘f’: prog.c:7:5: warning: control reaches end of non-void function [-Wreturn-type] } ^
Standard output is empty