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