Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 4 years ago

Language

C++

Compiler

gcc HEAD 12.0.0 20210705 (experimental)

Options
Warnings
Boost 1.73.0
C++2b(GNU)
no pedantic

Author

anonymous

almost 4 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2b
prog.cc: In function 'void change(Signal*)':
prog.cc:113:23: error: too many arguments to function 'void Change()'
  113 |                 Change(head);
      |                 ~~~~~~^~~~~~
prog.cc:75:6: note: declared here
   75 | void Change()
      |      ^~~~~~
prog.cc:102:19: warning: unused variable 'temp' [-Wunused-variable]
  102 |     struct Signal*temp,*buf;
      |                   ^~~~
prog.cc: In function 'void chaxun(Signal*)':
prog.cc:153:9: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'char (*)[10]' [-Wformat=]
  153 | scanf("%s",&s);
      |        ~^  ~~
      |         |  |
      |         |  char (*)[10]
      |         char*
prog.cc: In function 'void read(Signal*)':
prog.cc:183:17: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'char (*)[10]' [-Wformat=]
  183 |         scanf("%s",&filename);
      |                ~^  ~~~~~~~~~
      |                 |  |
      |                 |  char (*)[10]
      |                 char*
prog.cc:184:35: error: cannot convert 'bool' to 'FILE*' in assignment
  184 |         if(fp=fopen(filename,"r+")==NULL);     //以二进制的方式打开文件
      |                                   ^
      |                                   |
      |                                   bool
prog.cc:184:42: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
  184 |         if(fp=fopen(filename,"r+")==NULL);     //以二进制的方式打开文件
      |                                          ^
prog.cc:184:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  184 |         if(fp=fopen(filename,"r+")==NULL);     //以二进制的方式打开文件
      |         ^~
prog.cc:185:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  185 |         {
      |         ^
prog.cc:192:27: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'int' [-Wformat=]
  192 |            fscanf(fp,"%s,%d,%f,%d",p->Name,p->KB,p->Pos,p->Type);
      |                          ~^                ~~~~~
      |                           |                   |
      |                           int*                int
prog.cc:192:30: warning: format '%f' expects argument of type 'float*', but argument 5 has type 'double' [-Wformat=]
  192 |            fscanf(fp,"%s,%d,%f,%d",p->Name,p->KB,p->Pos,p->Type);
      |                             ~^                   ~~~~~~
      |                              |                      |
      |                              float*                 double
prog.cc:192:33: warning: format '%d' expects argument of type 'int*', but argument 6 has type 'int' [-Wformat=]
  192 |            fscanf(fp,"%s,%d,%f,%d",p->Name,p->KB,p->Pos,p->Type);
      |                                ~^                       ~~~~~~~
      |                                 |                          |
      |                                 int*                       int
prog.cc: In function 'void write(Signal*)':
prog.cc:227:25: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'char (*)[10]' [-Wformat=]
  227 |                 scanf("%s",&filename);
      |                        ~^  ~~~~~~~~~
      |                         |  |
      |                         |  char (*)[10]
      |                         char*
prog.cc: In function 'int main()':
prog.cc:266:22: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  266 |         while (option=6)
      |                ~~~~~~^~
Exit Code:
1