Author
anonymous
over 6 years ago
Language
C
Compiler
gcc 8.2.0
Options
Warnings
C11(GNU)
no pedantic
Author
anonymous
over 6 years ago
$ gcc prog.c -Wall -Wextra -std=gnu11
prog.c: In function 'main':
prog.c:11:17: warning: format '%c' expects argument of type 'char *', but argument 2 has type 'int (*)[201]' [-Wformat=]
while(scanf("%c", &string) == 1) {
~^ ~~~~~~~
prog.c:14:21: warning: comparison between pointer and integer
while(string[i] != "+"){
^~
prog.c:14:21: warning: comparison with string literal results in unspecified behavior [-Waddress]
prog.c:15:22: warning: operation on 'i' may be undefined [-Wsequence-point]
a[i] = string[i++];
~^~
prog.c:20:21: warning: comparison between pointer and integer
while(string[i] != "="){
^~
prog.c:20:21: warning: comparison with string literal results in unspecified behavior [-Waddress]
prog.c:21:22: warning: operation on 'i' may be undefined [-Wsequence-point]
b[i] = string[i++];
~^~
prog.c:35:14: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int *' [-Wformat=]
printf("%s\n", string);
~^ ~~~~~~
%ls
Exit Code:
0