Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 5 years ago

Language

Compiler

Options

Author

anonymous

almost 5 years ago

$
prog.cc:13:13: error: conflicting declaration 'typedef int S'
   13 | typedef int S;
      |             ^
prog.cc:12:8: note: previous declaration as 'struct S'
   12 | struct S { int i; };
      |        ^
prog.cc:18:14: error: aggregate 'Inner inner' has incomplete type and cannot be defined
   18 | struct Inner inner;
      |              ^~~~~
prog.cc:22:1: error: ISO C++ forbids declaration of 'g' with no type [-fpermissive]
   22 | g() {
      | ^
prog.cc:30:5: error: redefinition of 'int n'
   30 | int n;
      |     ^
prog.cc:29:5: note: 'int n' previously declared here
   29 | int n;
      |     ^
prog.cc:34:6: error: variable or field 'h' declared void
   34 | void h(i) int i; { }
      |      ^
prog.cc:34:8: error: 'i' was not declared in this scope
   34 | void h(i) int i; { }
      |        ^
prog.cc:34:18: error: expected unqualified-id before '{' token
   34 | void h(i) int i; { }
      |                  ^
prog.cc:38:1: error: new types may not be defined in a return type
   38 | struct S2{int a;} j(void) { struct S2 s = {1}; return s; }
      | ^~~~~~
prog.cc:38:1: note: (perhaps a semicolon is missing after the definition of 'S2')
prog.cc:47:12: error: invalid conversion from 'int' to 'E' [-fpermissive]
   47 | enum E e = 1;
      |            ^
      |            |
      |            int
prog.cc: In function 'void k()':
prog.cc:54:1: error: jump to label 'label'
   54 | label:
      | ^~~~~
prog.cc:51:10: note:   from here
   51 |     goto label; /* C allows jumping past an initialization */
      |          ^~~~~
prog.cc:53:13: note:   crosses initialization of 'int x'
   53 |         int x = 0;
      |             ^
prog.cc: In function 'int main()':
prog.cc:66:8: error: too many arguments to function 'void f()'
   66 |     f(1); /* doesn't match declaration in C++ */
      |        ^
prog.cc:63:6: note: declared here
   63 | void f();
      |      ^
prog.cc:69:13: error: expected unqualified-id before 'new'
   69 |         int new = 0;
      |             ^~~
prog.cc:75:5: error: 'puts' was not declared in this scope
   75 |     puts("C is not C++");
      |     ^~~~
prog.cc:80:14: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   80 |         ip = vp; /* cast required in C++, not in C */
      |              ^~
      |              |
      |              void*
Exit Code:
1