/* Extern at function scope, clashing with extern at file scope */
-extern int foo1; /* { dg-error "previous" } */
-extern int bar1(int); /* { dg-error "previous" } */
+extern int foo1; /* { dg-message "note: previous" } */
+extern int bar1(int); /* { dg-message "note: previous" } */
void test1(void)
{
void test2(void)
{
- extern double foo2; /* { dg-error "previous" } */
- extern double bar2(double); /* { dg-error "previous" } */
+ extern double foo2; /* { dg-message "note: previous" } */
+ extern double bar2(double); /* { dg-message "note: previous" } */
}
extern int foo2; /* { dg-error "conflict" } */
void prime3(void)
{
- extern int foo3; /* { dg-error "previous" } */
- extern int bar3(int); /* { dg-error "previous" } */
- extern int baz3; /* { dg-error "previous" } */
+ extern int foo3; /* { dg-message "note: previous" } */
+ extern int bar3(int); /* { dg-message "note: previous" } */
+ extern int baz3; /* { dg-message "note: previous" } */
}
void test3(void)
void prime4(void)
{
- bar4(); /* { dg-error "previous|implicit" } */
+ bar4(); /* { dg-warning "implicit declaration of function" } */
}
void test4(void)
{
extern double bar4(double); /* { dg-error "conflict" } */
+/* { dg-message "note: previous implicit declaration" "" { target *-*-* } 55 } */
}
/* Implicit decl, clashing with extern at previous function scope. */
void prime5(void)
{
- extern double bar5(double); /* { dg-error "previous" "" } */
-}
+ extern double bar5(double); /* { dg-message "note: previous declaration" "" } */
+} /* { dg-message "note: previous implicit declaration" "" { target *-*-* } 68 } */
void test5(void)
{
- bar5(1); /* { dg-error "implicit" } */
-}
+ bar5(1); /* { dg-warning "implicit declaration of function" } */
+} /* { dg-error "incompatible implicit declaration" "" { target *-*-* } 73 } */
/* Extern then static, both at file scope. */
-extern int test6(int); /* { dg-warning "previous" "" } */
-static int test6(int x)
-{ return x; } /* { dg-warning "follows non-static" } */
+extern int test6(int); /* { dg-message "note: previous" "" } */
+static int test6(int x) /* { dg-error "follows non-static" } */
+{ return x; }
/* Extern then static, extern at previous function scope. */
void prime7(void)
{
- extern int test7(int); /* { dg-warning "previous" "" } */
+ extern int test7(int); /* { dg-message "note: previous" "" } */
}
-static int test7(int x)
-{ return x; } /* { dg-warning "follows non-static" } */
+static int test7(int x) /* { dg-error "follows non-static" } */
+{ return x; }
/* Implicit decl then static. */
void prime8(void)
{
- test8(); /* { dg-warning "previous" "" } */
- /* { dg-warning "implicit" "implicit" { target *-*-* } 96 } */
+ test8(); /* { dg-message "note: previous" "" } */
+ /* { dg-warning "implicit" "implicit" { target *-*-* } 97 } */
}
-static int test8(int x)
-{ return x; } /* { dg-warning "follows non-static" } */
+static int test8(int x) /* { dg-error "follows non-static" } */
+{ return x; }