Author
anonymous
almost 5 years ago
Language
C
Compiler
gcc 10.1.0
Options
Warnings
C11(GNU)
no pedantic
Author
anonymous
almost 5 years ago
$ gcc prog.c -Wall -Wextra -std=gnu11
prog.c: In function 'get_int':
prog.c:6:25: warning: unused parameter 'x' [-Wunused-parameter]
6 | int get_int(const char* x) { return 42; }
| ~~~~~~~~~~~~^
prog.c: In function 'get_string':
prog.c:7:31: warning: unused parameter 'x' [-Wunused-parameter]
7 | string get_string(const char* x) { return "hoge"; }
| ~~~~~~~~~~~~^
prog.c: In function 'search':
prog.c:56:9: error: expected expression before '}' token
56 | }
| ^
prog.c:56:9: warning: 'return' with a value, in function returning void [-Wreturn-type]
prog.c:41:6: note: declared here
41 | void search(int count, person people[])
| ^~~~~~
prog.c:58:5: error: 'else' without a previous 'if'
58 | else
| ^~~~
prog.c:72:79: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
72 | if (strcmp(try_again, "Yes") == 0 || strcmp(try_again, "yes") == 0 || (int) try_again == 89 || (int) try_again == 121)
| ^
prog.c:72:104: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
72 | if (strcmp(try_again, "Yes") == 0 || strcmp(try_again, "yes") == 0 || (int) try_again == 89 || (int) try_again == 121)
| ^
prog.c:74:13: warning: implicit declaration of function 'sreach'; did you mean 'search'? [-Wimplicit-function-declaration]
74 | sreach(count, people);
| ^~~~~~
| search
prog.c:77:5: error: expected expression before '}' token
77 | }
| ^
prog.c:77:5: warning: 'return' with a value, in function returning void [-Wreturn-type]
prog.c:41:6: note: declared here
41 | void search(int count, person people[])
| ^~~~~~
Exit Code:
1