Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 6 years ago

Language

C

Compiler

gcc 9.1.0

Options
Warnings
C11(GNU)
no pedantic
Raw compiler options
-c

Author

anonymous

almost 6 years ago

$ gcc prog.c -Wall -Wextra -std=gnu11 -c
prog.c: In function 'check':
prog.c:58:7: warning: implicit declaration of function 'checkFrip' [-Wimplicit-function-declaration]
   58 |   if (checkFrip(y, x, turn, vec) == 1)
      |       ^~~~~~~~~
prog.c: At top level:
prog.c:63:1: warning: data definition has no type or storage class
   63 | vec_y[] = { -1, -1, 0, 1, 1, 1, 0, -1 };
      | ^~~~~
prog.c:63:1: warning: type defaults to 'int' in declaration of 'vec_y' [-Wimplicit-int]
prog.c:64:1: warning: data definition has no type or storage class
   64 | vec_x[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
      | ^~~~~
prog.c:64:1: warning: type defaults to 'int' in declaration of 'vec_x' [-Wimplicit-int]
prog.c: In function 'input':
prog.c:96:11: warning: implicit declaration of function 'rand' [-Wimplicit-function-declaration]
   96 |   place = rand() % 89;
      |           ^~~~
prog.c:104:19: warning: format '%d' expects a matching 'int' argument [-Wformat=]
  104 |    printf("input[%d]:error\n,place");
      |                  ~^
      |                   |
      |                   int
prog.c:90:16: warning: unused parameter 'turn' [-Wunused-parameter]
   90 | void input(int turn)
      |            ~~~~^~~~
prog.c: In function 'main':
prog.c:182:4: warning: implicit declaration of function 'ai_rand'; did you mean 'srand'? [-Wimplicit-function-declaration]
  182 |    ai_rand(turn);
      |    ^~~~~~~
      |    srand
prog.c:192:11: warning: implicit declaration of function 'checkEnd'; did you mean 'check'? [-Wimplicit-function-declaration]
  192 |   switch (checkEnd(turn))
      |           ^~~~~~~~
      |           check
prog.c:203:3: warning: implicit declaration of function 'checkWinner' [-Wimplicit-function-declaration]
  203 |  }checkWinner();
      |   ^~~~~~~~~~~
prog.c: In function 'checkFrip':
prog.c:88:1: warning: control reaches end of non-void function [-Wreturn-type]
   88 | }
      | ^
prog.c: In function 'main':
prog.c:196:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
  196 |    turn = (turn + 1)%2;
      |    ~~~~~^~~~~~~~~~~~~~
prog.c:197:3: note: here
  197 |   case 2:
      |   ^~~~
execve: Permission denied
Exit Code:
1