Index: gcc/testsuite/gcc.target/powerpc/altivec-macros.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/altivec-macros.c (revision 138311) +++ gcc/testsuite/gcc.target/powerpc/altivec-macros.c (working copy) @@ -53,11 +53,11 @@ _Pragma ("__vector") /* { dg-warning "redefined" "__bool redefined" { target *-*-* } 46 } */ /* { dg-warning "redefined" "vector redefined" { target *-*-* } 47 } */ /* { dg-warning "redefined" "pixel redefined" { target *-*-* } 48 } */ /* { dg-warning "redefined" "bool redefined" { target *-*-* } 49 } */ -/* { dg-warning "previous" "prev __vector defn" { target *-*-* } 24 } */ -/* { dg-warning "previous" "prev __pixel defn" { target *-*-* } 27 } */ -/* { dg-warning "previous" "prev __bool defn" { target *-*-* } 30 } */ -/* { dg-warning "previous" "prev vector defn" { target *-*-* } 33 } */ -/* { dg-warning "previous" "prev pixel defn" { target *-*-* } 36 } */ -/* { dg-warning "previous" "prev bool defn" { target *-*-* } 39 } */ +/* { dg-message "note: previous" "prev __vector defn" { target *-*-* } 24 } */ +/* { dg-message "note: previous" "prev __pixel defn" { target *-*-* } 27 } */ +/* { dg-message "note: previous" "prev __bool defn" { target *-*-* } 30 } */ +/* { dg-message "note: previous" "prev vector defn" { target *-*-* } 33 } */ +/* { dg-message "note: previous" "prev pixel defn" { target *-*-* } 36 } */ +/* { dg-message "note: previous" "prev bool defn" { target *-*-* } 39 } */ Index: gcc/testsuite/gcc.target/i386/regparm.c =================================================================== --- gcc/testsuite/gcc.target/i386/regparm.c (revision 138311) +++ gcc/testsuite/gcc.target/i386/regparm.c (working copy) @@ -1,10 +1,10 @@ /* { dg-do compile } */ /* { dg-require-effective-target ilp32 } */ /* { dg-options "-W -Wall" } */ /* Verify that GCC correctly detects non-matching regparm attributes. */ -int __attribute__((regparm(3))) f (void); /* { dg-error "previous" } */ +int __attribute__((regparm(3))) f (void); /* { dg-message "note: previous" } */ int __attribute__((regparm(2))) f (void) { /* { dg-error "conflicting" } */ return 0; } Index: gcc/testsuite/gcc.dg/funcdef-var-1.c =================================================================== --- gcc/testsuite/gcc.dg/funcdef-var-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/funcdef-var-1.c (working copy) @@ -3,8 +3,8 @@ . */ /* { dg-do compile } */ /* { dg-options "-Wmissing-prototypes" } */ extern __typeof(foo) foo __asm__(""); /* { dg-error "undeclared" } */ -/* { dg-error "previous declaration" "previous declaration" { target *-*-* } 7 } */ +/* { dg-message "note: previous declaration" "previous declaration" { target *-*-* } 7 } */ void *foo (void) {} /* { dg-error "redeclared as different kind of symbol" } */ /* { dg-warning "no previous prototype" "no previous prototype" { target *-*-* } 9 } */ Index: gcc/testsuite/gcc.dg/parm-mismatch-1.c =================================================================== --- gcc/testsuite/gcc.dg/parm-mismatch-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/parm-mismatch-1.c (working copy) @@ -2,17 +2,17 @@ (). */ /* Origin: Joseph Myers */ /* { dg-do compile } */ /* { dg-options "" } */ -void f0(); /* { dg-error "previous declaration of 'f0' was here" } */ +void f0(); /* { dg-message "note: previous declaration of 'f0' was here" } */ void f0(int, ...); /* { dg-error "conflicting types for 'f0'" } */ /* { dg-message "note: a parameter list with an ellipsis can't match an empty parameter name list declaration" "note" { target *-*-* } 8 } */ -void f1(int, ...); /* { dg-error "previous declaration of 'f1' was here" } */ +void f1(int, ...); /* { dg-message "note: previous declaration of 'f1' was here" } */ void f1(); /* { dg-error "conflicting types for 'f1'" } */ /* { dg-message "note: a parameter list with an ellipsis can't match an empty parameter name list declaration" "note" { target *-*-* } 11 } */ -void f2(); /* { dg-error "previous declaration of 'f2' was here" } */ +void f2(); /* { dg-message "note: previous declaration of 'f2' was here" } */ void f2(char); /* { dg-error "conflicting types for 'f2'" } */ /* { dg-message "note: an argument type that has a default promotion can't match an empty parameter name list declaration" "note" { target *-*-* } 14 } */ -void f3(char); /* { dg-error "previous declaration of 'f3' was here" } */ +void f3(char); /* { dg-message "note: previous declaration of 'f3' was here" } */ void f3(); /* { dg-error "conflicting types for 'f3'" } */ /* { dg-message "note: an argument type that has a default promotion can't match an empty parameter name list declaration" "note" { target *-*-* } 17 } */ Index: gcc/testsuite/gcc.dg/attr-noinline.c =================================================================== --- gcc/testsuite/gcc.dg/attr-noinline.c (revision 138311) +++ gcc/testsuite/gcc.dg/attr-noinline.c (working copy) @@ -11,35 +11,35 @@ static void function_declaration_both_af static inline void __attribute__((__noinline__)) function_declaration_both_after(void); /* { dg-warning "(inline function \[^\n\]* given attribute noinline|declared inline after its definition)" "" } */ static void function_declaration_both_after(void) {} -static void function_declaration_noinline_before(void) __attribute__((__noinline__)); /* { dg-warning "previous declaration" "" } */ +static void function_declaration_noinline_before(void) __attribute__((__noinline__)); /* { dg-message "note: previous declaration" "" } */ static inline void function_declaration_noinline_before(void) {} /* { dg-warning "follows declaration with attribute noinline" "" } */ -static inline void function_declaration_noinline_after(void) {} /* { dg-warning "previous definition" "" } */ +static inline void function_declaration_noinline_after(void) {} /* { dg-message "note: previous definition" "" } */ static void function_declaration_noinline_after(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */ -static inline void function_declaration_inline_before(void); /* { dg-warning "previous declaration" "" } */ +static inline void function_declaration_inline_before(void); /* { dg-message "note: previous declaration" "" } */ static void __attribute__((__noinline__)) function_declaration_inline_before(void) {} /* { dg-warning "follows inline declaration" "" } */ -static inline void function_declaration_inline_noinline_before(void); /* { dg-warning "previous declaration" "" } */ +static inline void function_declaration_inline_noinline_before(void); /* { dg-message "note: previous declaration" "" } */ static void function_declaration_inline_noinline_before(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */ static void function_declaration_inline_noinline_before(void) {} static inline void function_declaration_inline_noinline_after(void); -static void function_declaration_inline_noinline_after(void) {} /* { dg-warning "previous definition" "" } */ +static void function_declaration_inline_noinline_after(void) {} /* { dg-message "note: previous definition" "" } */ static void function_declaration_inline_noinline_after(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */ -static void function_declaration_noinline_inline_before(void) __attribute__((__noinline__)); /* { dg-warning "previous declaration" "" } */ +static void function_declaration_noinline_inline_before(void) __attribute__((__noinline__)); /* { dg-message "note: previous declaration" "" } */ static inline void function_declaration_noinline_inline_before(void); /* { dg-warning "follows declaration with attribute noinline" "" } */ static void function_declaration_noinline_inline_before(void) {} Index: gcc/testsuite/gcc.dg/wtr-static-1.c =================================================================== --- gcc/testsuite/gcc.dg/wtr-static-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/wtr-static-1.c (working copy) @@ -2,11 +2,11 @@ Note, gcc should omit these warnings in system header files. By Kaveh R. Ghazi 8/22/2000. */ /* { dg-do compile } */ /* { dg-options "-Wtraditional" } */ -static void testfunc1(void); /* { dg-warning "previous declaration" } */ +static void testfunc1(void); /* { dg-message "note: previous declaration" } */ void testfunc1() {} /* { dg-warning "non-static.*follows static" "non-static follows static" } */ # 11 "sys-header.h" 3 /* We are in system headers now, no -Wtraditional warnings should issue. */ Index: gcc/testsuite/gcc.dg/redecl-11.c =================================================================== --- gcc/testsuite/gcc.dg/redecl-11.c (revision 138311) +++ gcc/testsuite/gcc.dg/redecl-11.c (working copy) @@ -3,7 +3,7 @@ /* Origin: Joseph Myers */ /* { dg-do compile } */ /* { dg-options "" } */ int f(int (*)[]); -void g() { int f(int (*)[2]); } /* { dg-error "previous declaration of 'f' was here" } */ +void g() { int f(int (*)[2]); } /* { dg-message "note: previous declaration of 'f' was here" } */ int f(int (*)[3]); /* { dg-error "conflicting types for 'f'" } */ Index: gcc/testsuite/gcc.dg/pr27953.c =================================================================== --- gcc/testsuite/gcc.dg/pr27953.c (revision 138311) +++ gcc/testsuite/gcc.dg/pr27953.c (working copy) @@ -3,6 +3,6 @@ void foo(struct A a) {} /* { dg-warning "declared inside parameter list" } */ /* { dg-warning "its scope is only" "" { target *-*-* } 3 } */ /* { dg-error "incomplete type" "" { target *-*-* } 3 } */ void foo() {} /* { dg-error "redefinition" } */ -/* { dg-error "previous definition" "" { target *-*-* } 3 } */ +/* { dg-message "note: previous definition" "" { target *-*-* } 3 } */ Index: gcc/testsuite/gcc.dg/proto-1.c =================================================================== --- gcc/testsuite/gcc.dg/proto-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/proto-1.c (working copy) @@ -1,5 +1,5 @@ /* PR c/28502 */ /* { dg-do compile } */ -void foo() {} /* { dg-error "previous" } */ +void foo() {} /* { dg-message "note: previous" } */ void foo(void[]); /* { dg-error "array of voids" } */ Index: gcc/testsuite/gcc.dg/decl-3.c =================================================================== --- gcc/testsuite/gcc.dg/decl-3.c (revision 138311) +++ gcc/testsuite/gcc.dg/decl-3.c (working copy) @@ -1,5 +1,5 @@ /* PR c/9928 */ /* { dg-do compile } */ -enum { CODES }; /* { dg-error "previous definition" } */ +enum { CODES }; /* { dg-message "note: previous definition" } */ enum { CODES }; /* { dg-error "conflicting types|redeclaration of enumerator" } */ Index: gcc/testsuite/gcc.dg/redecl-13.c =================================================================== --- gcc/testsuite/gcc.dg/redecl-13.c (revision 138311) +++ gcc/testsuite/gcc.dg/redecl-13.c (working copy) @@ -3,7 +3,7 @@ /* Origin: Joseph Myers */ /* { dg-do compile } */ /* { dg-options "" } */ extern int a[]; -void f(void) { extern int a[10]; } /* { dg-error "previous declaration of 'a' was here" } */ +void f(void) { extern int a[10]; } /* { dg-message "note: previous declaration of 'a' was here" } */ extern int a[5]; /* { dg-error "conflicting types for 'a'" } */ Index: gcc/testsuite/gcc.dg/pr15360-1.c =================================================================== --- gcc/testsuite/gcc.dg/pr15360-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/pr15360-1.c (working copy) @@ -13,12 +13,12 @@ static int a; static int b; extern int b = 1; /* { dg-warning "initialized and declared" "extern init warning" } */ static int b; static int b; -static int c; /* { dg-error "previous declaration" "" } */ +static int c; /* { dg-message "note: previous declaration" "" } */ int c; /* { dg-error "non-static" "correct error" } */ -static int d; /* { dg-error "previous declaration" "" } */ +static int d; /* { dg-message "note: previous declaration" "" } */ int d = 1; /* { dg-error "non-static" "correct error" } */ void foo (void) { extern int e = 1; } /* { dg-error "has both" "extern init in function" } */ Index: gcc/testsuite/gcc.dg/pr36901-1.c =================================================================== --- gcc/testsuite/gcc.dg/pr36901-1.c (revision 0) +++ gcc/testsuite/gcc.dg/pr36901-1.c (revision 0) @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors" } */ +#include "pr36901-system.h" +void foo(void) +{ + int s = sc; +} Index: gcc/testsuite/gcc.dg/redecl-15.c =================================================================== --- gcc/testsuite/gcc.dg/redecl-15.c (revision 138311) +++ gcc/testsuite/gcc.dg/redecl-15.c (working copy) @@ -5,10 +5,10 @@ /* { dg-options "" } */ void f (void) { - g(); /* { dg-warning "previous implicit declaration of 'g' was here" } */ + g(); /* { dg-message "note: previous implicit declaration of 'g' was here" } */ { void g(); /* { dg-warning "conflicting types for 'g'" } */ } } Index: gcc/testsuite/gcc.dg/enum-compat-1.c =================================================================== --- gcc/testsuite/gcc.dg/enum-compat-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/enum-compat-1.c (working copy) @@ -23,10 +23,10 @@ enum e4 { B }; enum e3 v3; enum e4 *p = &v3; /* { dg-warning "incompatible" "incompatible pointer" } */ enum e3 *q = &v3; -void g(enum e3); /* { dg-error "declaration" "error at first decl" } */ +void g(enum e3); /* { dg-message "note: previous declaration" "error at first decl" } */ void g(enum e4); /* { dg-error "conflicting types" "error at second decl" } */ void h(enum e3); void h(enum e3); Index: gcc/testsuite/gcc.dg/pr36901-3.c =================================================================== --- gcc/testsuite/gcc.dg/pr36901-3.c (revision 0) +++ gcc/testsuite/gcc.dg/pr36901-3.c (revision 0) @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors" } */ +#include "pr36901.h" +void foo(void) +{ + int s = sc; +} +/* { dg-message "file included" "In file included" { target *-*-* } 0 } */ +/* { dg-warning "overflow" "overflow" { target *-*-* } 0 } */ +/* { dg-error "overflow" "overflow" { target *-*-* } 0 } */ Index: gcc/testsuite/gcc.dg/dll-3.c =================================================================== --- gcc/testsuite/gcc.dg/dll-3.c (revision 138311) +++ gcc/testsuite/gcc.dg/dll-3.c (working copy) @@ -3,11 +3,11 @@ /* { dg-do compile { target arm*-*-pe* } } */ /* { dg-do compile { target i?86-pc-cygwin } } */ /* { dg-do compile { target i?86-pc-mingw* } } */ __declspec (dllimport) int foo1 (); -__declspec (dllexport) int foo1 (); /* { dg-warning "previous dllimport ignored" } */ +__declspec (dllexport) int foo1 (); /* { dg-message "note: previous dllimport ignored" } */ __declspec (dllexport) int foo2 (); __declspec (dllimport) int foo2 (); /* { dg-warning "dllimport ignored" } */ __declspec (dllexport) int foo1 () { return foo2 (); } Index: gcc/testsuite/gcc.dg/array-5.c =================================================================== --- gcc/testsuite/gcc.dg/array-5.c (revision 138311) +++ gcc/testsuite/gcc.dg/array-5.c (working copy) @@ -11,11 +11,11 @@ char arr0[1]; a gcc extension, but it should work like any other constant. */ extern char arr1[1]; char arr1[1]; extern char arr2[0]; char arr2[0]; -extern char arr3[0]; /* { dg-error "previous declaration" } */ +extern char arr3[0]; /* { dg-message "note: previous declaration" } */ char arr3[1]; /* { dg-error "conflicting types" } */ /* Variable size matches. */ void func(int n, int m) { Index: gcc/testsuite/gcc.dg/Wredundant-decls-2.c =================================================================== --- gcc/testsuite/gcc.dg/Wredundant-decls-2.c (revision 138311) +++ gcc/testsuite/gcc.dg/Wredundant-decls-2.c (working copy) @@ -1,24 +1,24 @@ /* Test for -Wredundant-decls warnings */ /* { dg-do compile } */ /* { dg-options "-Wredundant-decls" } */ -int j = 5; /* { dg-warning "previous" } */ +int j = 5; /* { dg-message "note: previous" } */ int j; /* { dg-warning "redundant" } */ static int k; -static int k = 5; /* { dg-warning "previous" } */ +static int k = 5; /* { dg-message "note: previous" } */ static int k; /* { dg-warning "redundant" } */ -static int l = 5; /* { dg-warning "previous" } */ +static int l = 5; /* { dg-message "note: previous" } */ static int l; /* { dg-warning "redundant" } */ -static int m; /* { dg-warning "previous" } */ +static int m; /* { dg-message "note: previous" } */ static int m; /* { dg-warning "redundant" } */ static int m = 5; -int n; /* { dg-warning "previous" } */ +int n; /* { dg-message "note: previous" } */ int n; /* { dg-warning "redundant" } */ int n = 5; static int o; static int o = 5; Index: gcc/testsuite/gcc.dg/inline4.c =================================================================== --- gcc/testsuite/gcc.dg/inline4.c (revision 138311) +++ gcc/testsuite/gcc.dg/inline4.c (working copy) @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-Wall -std=gnu89" } */ /* This testcase should fail since we're redefining foo in the same translation unit. */ -int foo (void) { return 2; } /* { dg-error "previous definition of" } */ +int foo (void) { return 2; } /* { dg-message "note: previous definition of" } */ extern inline int foo (void) { return 1; } /* { dg-error "redefinition of" } */ Index: gcc/testsuite/gcc.dg/redecl-2.c =================================================================== --- gcc/testsuite/gcc.dg/redecl-2.c (revision 138311) +++ gcc/testsuite/gcc.dg/redecl-2.c (working copy) @@ -5,60 +5,60 @@ /* { dg-options "" } */ void fa0 (void) { - int a0; /* { dg-error "previous declaration" } */ + int a0; /* { dg-message "note: previous declaration" } */ int a0; /* { dg-error "redeclaration" } */ } void fa1 (void) { - int a1; /* { dg-error "previous declaration" } */ + int a1; /* { dg-message "note: previous declaration" } */ static int a1; /* { dg-error "redeclaration" } */ } void fa2 (void) { - int a2; /* { dg-error "previous declaration" } */ + int a2; /* { dg-message "note: previous declaration" } */ extern int a2; /* { dg-error "follows declaration with no linkage" } */ } void fa3 (void) { - static int a3; /* { dg-error "previous declaration" } */ + static int a3; /* { dg-message "note: previous declaration" } */ int a3; /* { dg-error "redeclaration" } */ } void fa4 (void) { - static int a4; /* { dg-error "previous declaration" } */ + static int a4; /* { dg-message "note: previous declaration" } */ static int a4; /* { dg-error "redeclaration" } */ } void fa5 (void) { - static int a5; /* { dg-error "previous declaration" } */ + static int a5; /* { dg-message "note: previous declaration" } */ extern int a5; /* { dg-error "follows declaration with no linkage" } */ } void fa6 (void) { - extern int a6; /* { dg-error "previous declaration" } */ + extern int a6; /* { dg-message "note: previous declaration" } */ int a6; /* { dg-error "follows extern declaration" } */ } void fa7 (void) { - extern int a7; /* { dg-error "previous declaration" } */ + extern int a7; /* { dg-message "note: previous declaration" } */ static int a7; /* { dg-error "follows extern declaration" } */ } void fa8 (void) Index: gcc/testsuite/gcc.dg/inline-14.c =================================================================== --- gcc/testsuite/gcc.dg/inline-14.c (revision 138311) +++ gcc/testsuite/gcc.dg/inline-14.c (working copy) @@ -1,21 +1,21 @@ /* Check that you can't redefine a C99 inline function. */ /* { dg-do compile } */ /* { dg-options "-std=c99" } */ extern inline int func1 (void) -{ /* { dg-error "previous definition" } */ +{ /* { dg-message "note: previous definition" } */ return 1; } inline int func1 (void) /* { dg-error "redefinition" } */ { return 1; } inline int func2 (void) -{ /* { dg-error "previous definition" } */ +{ /* { dg-message "note: previous definition" } */ return 2; } inline int func2 (void) /* { dg-error "redefinition" } */ { Index: gcc/testsuite/gcc.dg/tls/diag-3.c =================================================================== --- gcc/testsuite/gcc.dg/tls/diag-3.c (revision 138311) +++ gcc/testsuite/gcc.dg/tls/diag-3.c (working copy) @@ -1,11 +1,11 @@ /* Report invalid extern and __thread combinations. */ /* { dg-require-effective-target tls } */ -extern int j; /* { dg-error "previous declaration" } */ +extern int j; /* { dg-message "note: previous declaration" } */ __thread int j; /* { dg-error "follows non-thread-local" } */ -extern __thread int i; /* { dg-error "previous declaration" } */ +extern __thread int i; /* { dg-message "note: previous declaration" } */ int i; /* { dg-error "follows thread-local" } */ extern __thread int k; /* This is fine. */ __thread int k; Index: gcc/testsuite/gcc.dg/funcdef-var-2.c =================================================================== --- gcc/testsuite/gcc.dg/funcdef-var-2.c (revision 138311) +++ gcc/testsuite/gcc.dg/funcdef-var-2.c (working copy) @@ -4,8 +4,8 @@ /* { dg-do compile } */ /* { dg-options "-Wmissing-prototypes" } */ int foo; -/* { dg-error "previous declaration" "previous declaration" { target *-*-* } 8 } */ +/* { dg-message "note: previous declaration" "previous declaration" { target *-*-* } 8 } */ void foo () {} /* { dg-error "redeclared as different kind of symbol" } */ /* { dg-warning "no previous prototype" "no previous prototype" { target *-*-* } 10 } */ Index: gcc/testsuite/gcc.dg/20041213-1.c =================================================================== --- gcc/testsuite/gcc.dg/20041213-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/20041213-1.c (working copy) @@ -1,33 +1,33 @@ /* { dg-do compile } */ /* { dg-options "" } */ /* test redeclarations with void and implicit int */ -extern foo1(); /* { dg-error "previous declaration" } */ +extern foo1(); /* { dg-message "note: previous declaration" } */ extern void foo1(); /* { dg-error "conflicting types" } */ -extern void foo2(); /* { dg-error "previous declaration" } */ +extern void foo2(); /* { dg-message "note: previous declaration" } */ extern foo2(); /* { dg-error "conflicting types" } */ -void foo3() {} /* { dg-error "previous definition" } */ +void foo3() {} /* { dg-message "note: previous definition" } */ extern foo3(); /* { dg-error "conflicting types" } */ -extern foo4(); /* { dg-error "previous declaration" } */ +extern foo4(); /* { dg-message "note: previous declaration" } */ void foo4() {} /* { dg-error "conflicting types" } */ -extern void foo5(); /* { dg-warning "previous declaration" } */ +extern void foo5(); /* { dg-message "note: previous declaration" } */ foo5() {} /* { dg-warning "conflicting types" } */ -foo6() {} /* { dg-error "previous definition" } */ +foo6() {} /* { dg-message "note: previous definition" } */ extern void foo6(); /* { dg-error "conflicting types" } */ -foo7() {} /* { dg-error "previous definition" } */ +foo7() {} /* { dg-message "note: previous definition" } */ void foo7() {} /* { dg-error "conflicting types" } */ -void foo8() {} /* { dg-error "previous definition" } */ +void foo8() {} /* { dg-message "note: previous definition" } */ foo8() {} /* { dg-error "conflicting types" } */ -int use9() { foo9(); } /* { dg-warning "previous implicit declaration" } */ +int use9() { foo9(); } /* { dg-message "note: previous implicit declaration" } */ extern void foo9(); /* { dg-warning "conflicting types" } */ -int use10() { foo10(); } /* { dg-warning "previous implicit declaration" } */ +int use10() { foo10(); } /* { dg-message "note: previous implicit declaration" } */ void foo10() {} /* { dg-warning "conflicting types" } */ Index: gcc/testsuite/gcc.dg/old-style-then-proto-1.c =================================================================== --- gcc/testsuite/gcc.dg/old-style-then-proto-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/old-style-then-proto-1.c (working copy) @@ -5,40 +5,40 @@ /* { dg-options "" } */ void f1() {} void f1(void); /* { dg-warning "prototype for 'f1' follows non-prototype definition" } */ -void f2() {} /* { dg-error "previous definition of 'f2' was here" } */ +void f2() {} /* { dg-message "note: previous definition of 'f2' was here" } */ void f2(int); /* { dg-error "prototype for 'f2' declares more arguments than previous old-style definition" } */ -void f3(a) int a; {} /* { dg-error "previous definition of 'f3' was here" } */ +void f3(a) int a; {} /* { dg-message "note: previous definition of 'f3' was here" } */ void f3(void); /* { dg-error "prototype for 'f3' declares fewer arguments than previous old-style definition" } */ void f4(a) int a; {} void f4(int); /* { dg-warning "prototype for 'f4' follows non-prototype definition" } */ -void f5(a) int a; {} /* { dg-error "previous definition of 'f5' was here" } */ +void f5(a) int a; {} /* { dg-message "note: previous definition of 'f5' was here" } */ void f5(int, int); /* { dg-error "prototype for 'f5' declares more arguments than previous old-style definition" } */ -void f6(a) int a; {} /* { dg-error "previous definition of 'f6' was here" } */ +void f6(a) int a; {} /* { dg-message "note: previous definition of 'f6' was here" } */ void f6(int, ...); /* { dg-error "conflicting types for 'f6'" } */ -void f7(a, b) int a, b; {} /* { dg-error "previous definition of 'f7' was here" } */ +void f7(a, b) int a, b; {} /* { dg-message "note: previous definition of 'f7' was here" } */ void f7(int); /* { dg-error "prototype for 'f7' declares fewer arguments than previous old-style definition" } */ -void f8(a, b) int a, b; {} /* { dg-error "previous definition of 'f8' was here" } */ +void f8(a, b) int a, b; {} /* { dg-message "note: previous definition of 'f8' was here" } */ void f8(int, ...); /* { dg-error "conflicting types for 'f8'" } */ void f9(a, b) int a, b; {} void f9(int, int); /* { dg-warning "prototype for 'f9' follows non-prototype definition" } */ -void f10(a, b) int a, b; {} /* { dg-error "previous definition of 'f10' was here" } */ +void f10(a, b) int a, b; {} /* { dg-message "note: previous definition of 'f10' was here" } */ void f10(int, long); /* { dg-error "prototype for 'f10' declares argument 2 with incompatible type" } */ -void f11(a, b) int a, b; {} /* { dg-error "previous definition of 'f11' was here" } */ +void f11(a, b) int a, b; {} /* { dg-message "note: previous definition of 'f11' was here" } */ void f11(long, int); /* { dg-error "prototype for 'f11' declares argument 1 with incompatible type" } */ void f12(a, b) const int a; volatile int b; {} void f12(volatile int, const int); /* { dg-warning "prototype for 'f12' follows non-prototype definition" } */ -void f13(a) const int a[2][2]; {} /* { dg-error "previous definition of 'f13' was here" } */ +void f13(a) const int a[2][2]; {} /* { dg-message "note: previous definition of 'f13' was here" } */ void f13(volatile int [2][2]); /* { dg-error "prototype for 'f13' declares argument 1 with incompatible type" } */ Index: gcc/testsuite/gcc.dg/decl-2.c =================================================================== --- gcc/testsuite/gcc.dg/decl-2.c (revision 138311) +++ gcc/testsuite/gcc.dg/decl-2.c (working copy) @@ -5,11 +5,11 @@ /* { dg-do compile } */ void foo(void) { char - c /* { dg-error "previous declaration" } */ + c /* { dg-message "note: previous declaration" } */ ; int i; int c /* { dg-error "conflicting types" } */ = i; Index: gcc/testsuite/gcc.dg/redecl-12.c =================================================================== --- gcc/testsuite/gcc.dg/redecl-12.c (revision 138311) +++ gcc/testsuite/gcc.dg/redecl-12.c (working copy) @@ -3,7 +3,7 @@ /* Origin: Joseph Myers */ /* { dg-do compile } */ /* { dg-options "" } */ extern int a[]; -void f(void) { extern int a[]; extern int a[10]; } /* { dg-error "previous declaration of 'a' was here" } */ +void f(void) { extern int a[]; extern int a[10]; } /* { dg-message "note: previous declaration of 'a' was here" } */ extern int a[5]; /* { dg-error "conflicting types for 'a'" } */ Index: gcc/testsuite/gcc.dg/decl-4.c =================================================================== --- gcc/testsuite/gcc.dg/decl-4.c (revision 138311) +++ gcc/testsuite/gcc.dg/decl-4.c (working copy) @@ -1,10 +1,10 @@ /* Redeclaration of parameters is an error. PR 13728. */ /* { dg-do compile } */ -void f (int fred, /* { dg-error "previous definition" "" } */ +void f (int fred, /* { dg-message "note: previous definition" "" } */ int fred); /* { dg-error "redefinition of parameter" "" } */ -void f2 (int fred, /* { dg-error "previous definition" "" } */ +void f2 (int fred, /* { dg-message "note: previous definition" "" } */ int fred) /* { dg-error "redefinition of parameter" "" } */ { } Index: gcc/testsuite/gcc.dg/pr36901-system.h =================================================================== --- gcc/testsuite/gcc.dg/pr36901-system.h (revision 0) +++ gcc/testsuite/gcc.dg/pr36901-system.h (revision 0) @@ -0,0 +1,3 @@ +#pragma GCC system_header +#include "pr36901.h" + Index: gcc/testsuite/gcc.dg/Wshadow-1.c =================================================================== --- gcc/testsuite/gcc.dg/Wshadow-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/Wshadow-1.c (working copy) @@ -8,11 +8,11 @@ int decl1; /* { dg-warning "shadowed declaration" } */ void foo (double decl1) /* { dg-warning "shadows a global decl" } */ { } -void foo1 (int d) /* { dg-error "previous definition" } */ +void foo1 (int d) /* { dg-message "note: previous definition" } */ { double d; /* { dg-bogus "warning" "warning in place of error" } */ /* { dg-error "redeclared as different" "" { target *-*-* } 15 } */ } Index: gcc/testsuite/gcc.dg/transparent-union-2.c =================================================================== --- gcc/testsuite/gcc.dg/transparent-union-2.c (revision 138311) +++ gcc/testsuite/gcc.dg/transparent-union-2.c (working copy) @@ -3,16 +3,16 @@ /* { dg-options "-std=gnu99" } */ typedef union { int *i; long *l; } U __attribute__((transparent_union)); -extern void f0 (U); /* { dg-error "previous declaration" } */ +extern void f0 (U); /* { dg-message "note: previous declaration" } */ extern void f0 (void *); /* { dg-error "conflicting types" } */ -extern void f1 (U); /* { dg-error "previous declaration" } */ +extern void f1 (U); /* { dg-message "note: previous declaration" } */ extern void f1 (unsigned long); /* { dg-error "conflicting types" } */ -extern void f2 (void *); /* { dg-error "previous declaration" } */ +extern void f2 (void *); /* { dg-message "note: previous declaration" } */ extern void f2 (U); /* { dg-error "conflicting types" } */ -extern void f3 (unsigned long); /* { dg-error "previous declaration" } */ +extern void f3 (unsigned long); /* { dg-message "note: previous declaration" } */ extern void f3 (U); /* { dg-error "conflicting types" } */ Index: gcc/testsuite/gcc.dg/pr36901-2.c =================================================================== --- gcc/testsuite/gcc.dg/pr36901-2.c (revision 0) +++ gcc/testsuite/gcc.dg/pr36901-2.c (revision 0) @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors -w" } */ +#include "pr36901.h" +void foo(void) +{ + int s = sc; +} Index: gcc/testsuite/gcc.dg/visibility-7.c =================================================================== --- gcc/testsuite/gcc.dg/visibility-7.c (revision 138311) +++ gcc/testsuite/gcc.dg/visibility-7.c (working copy) @@ -3,10 +3,10 @@ /* { dg-require-visibility "protected" } */ /* { dg-final { scan-hidden "xyzzy" } } */ extern int __attribute__((visibility ("hidden"))) -xyzzy; /* { dg-warning "previous declaration" "" } */ +xyzzy; /* { dg-message "note: previous declaration" "" } */ int __attribute__((visibility ("protected"))) xyzzy = 5; /* { dg-warning "different visibility" "" } */ Index: gcc/testsuite/gcc.dg/dll-2.c =================================================================== --- gcc/testsuite/gcc.dg/dll-2.c (revision 138311) +++ gcc/testsuite/gcc.dg/dll-2.c (working copy) @@ -9,14 +9,14 @@ and functions. In C++, it only works for functions. */ /* { dg-require-dll "" } */ __declspec (dllimport) int foo1 (); -__declspec (dllexport) int foo1 (); /* { dg-warning "previous dllimport ignored" } */ +__declspec (dllexport) int foo1 (); /* { dg-message "note: previous dllimport ignored" } */ __declspec (dllexport) int foo2 (); __declspec (dllimport) int foo2 (); /* { dg-warning "dllimport ignored" } */ __declspec (dllimport) int bar1; -__declspec (dllexport) int bar1; /* { dg-warning "previous dllimport ignored" } */ +__declspec (dllexport) int bar1; /* { dg-message "note: previous dllimport ignored" } */ __declspec (dllexport) int bar2; __declspec (dllimport) int bar2; /* { dg-warning "dllimport ignored" } */ Index: gcc/testsuite/gcc.dg/redecl-16.c =================================================================== --- gcc/testsuite/gcc.dg/redecl-16.c (revision 138311) +++ gcc/testsuite/gcc.dg/redecl-16.c (working copy) @@ -12,7 +12,7 @@ extern IAP a[]; void f (void) { extern IA5P a[]; } -IAP a[] = { 0 }; /* { dg-error "previous definition" } */ +IAP a[] = { 0 }; /* { dg-message "note: previous definition" } */ extern IA10P a[]; /* { dg-error "conflicting types" } */ Index: gcc/testsuite/gcc.dg/inline1.c =================================================================== --- gcc/testsuite/gcc.dg/inline1.c (revision 138311) +++ gcc/testsuite/gcc.dg/inline1.c (working copy) @@ -1,8 +1,8 @@ /* { dg-do compile } */ /* { dg-options "-Wall -std=gnu89" } */ /* This test is expected to fail with an error for the redefinition of foo. This violates the constraint of 6.9#3 (no more than one external definition of an identifier with internal linkage in the same translation unit). */ -static inline int foo(void) { return 1; } /* { dg-error "previous definition of" } */ +static inline int foo(void) { return 1; } /* { dg-message "note: previous definition of" } */ static inline int foo(void) { return 0; } /* { dg-error "redefinition of" } */ Index: gcc/testsuite/gcc.dg/pr36901-4.c =================================================================== --- gcc/testsuite/gcc.dg/pr36901-4.c (revision 0) +++ gcc/testsuite/gcc.dg/pr36901-4.c (revision 0) @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors -Wsystem-headers" } */ +#include "pr36901-system.h" +void foo(void) +{ + int s = sc; +} +/* { dg-message "from " "In file included" { target *-*-* } 0 } */ +/* { dg-warning "overflow" "overflow" { target *-*-* } 0 } */ +/* { dg-error "overflow" "overflow" { target *-*-* } 0 } */ +/* { dg-error "#include_next is a GCC extension" "#include_next" { target *-*-* } 0 } */ Index: gcc/testsuite/gcc.dg/decl-8.c =================================================================== --- gcc/testsuite/gcc.dg/decl-8.c (revision 138311) +++ gcc/testsuite/gcc.dg/decl-8.c (working copy) @@ -1,10 +1,10 @@ /* Test diagnostics for duplicate typedefs. Basic diagnostics. */ /* Origin: Joseph Myers */ /* { dg-do compile } */ /* { dg-options "" } */ -typedef int I; /* { dg-error "previous declaration of 'I' was here" } */ +typedef int I; /* { dg-message "note: previous declaration of 'I' was here" } */ typedef int I; /* { dg-error "redefinition of typedef 'I'" } */ -typedef int I1; /* { dg-error "previous declaration of 'I1' was here" } */ +typedef int I1; /* { dg-message "note: previous declaration of 'I1' was here" } */ typedef long I1; /* { dg-error "conflicting types for 'I1'" } */ Index: gcc/testsuite/gcc.dg/nested-redef-1.c =================================================================== --- gcc/testsuite/gcc.dg/nested-redef-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/nested-redef-1.c (working copy) @@ -34,11 +34,11 @@ enum e0 { E0 = sizeof(enum e0 { E1 }) /* { dg-error "nested redefinition of 'enum e0'" } */ }; enum e1 { E2 = sizeof(enum e2 { E2 }), /* { dg-error "redeclaration of enumerator 'E2'" } */ - /* { dg-error "previous definition" "previous E2" { target *-*-* } 38 } */ + /* { dg-message "note: previous definition" "previous E2" { target *-*-* } 38 } */ E3 }; enum e3; enum e3 { E4 = 0 }; Index: gcc/testsuite/gcc.dg/inline3.c =================================================================== --- gcc/testsuite/gcc.dg/inline3.c (revision 138311) +++ gcc/testsuite/gcc.dg/inline3.c (working copy) @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-Wall -std=gnu89" } */ /* This testcase should fail since we're redefining foo in the same translation unit. */ extern inline int foo(void) { return 0; } -inline int foo (void) { return 1; } /* { dg-error "previous definition of" } */ +inline int foo (void) { return 1; } /* { dg-message "note: previous definition of" } */ int foo (void) { return 2; } /* { dg-error "redefinition of" } */ Index: gcc/testsuite/gcc.dg/redecl-1.c =================================================================== --- gcc/testsuite/gcc.dg/redecl-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/redecl-1.c (working copy) @@ -7,12 +7,12 @@ /* { dg-do compile } */ /* { dg-options "-std=c89 -pedantic -Wall -Wno-unused" } */ /* 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) { extern double foo1; /* { dg-error "conflict" } */ extern double bar1(double); /* { dg-error "conflict" } */ @@ -20,12 +20,12 @@ void test1(void) /* Extern at file scope, clashing with extern at function scope */ 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" } */ extern int bar2(int); /* { dg-error "conflict" } */ @@ -34,13 +34,13 @@ extern int bar2(int); /* { dg-error "co typedef float baz3; /* { dg-bogus } */ 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) { extern double foo3; /* { dg-error "conflict" } */ @@ -56,47 +56,47 @@ void prime4(void) } void test4(void) { extern double bar4(double); /* { dg-error "conflict" } */ -/* { dg-error "previous implicit declaration" "" { target *-*-* } 55 } */ +/* { 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-message "note: previous declaration" "" } */ -} /* { dg-error "previous implicit declaration" "" { target *-*-* } 68 } */ +} /* { dg-message "note: previous implicit declaration" "" { target *-*-* } 68 } */ void test5(void) { 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-error "previous" "" } */ +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-error "previous" "" } */ + extern int test7(int); /* { dg-message "note: previous" "" } */ } static int test7(int x) /* { dg-error "follows non-static" } */ { return x; } /* Implicit decl then static. */ void prime8(void) { - test8(); /* { dg-error "previous" "" } */ + test8(); /* { dg-message "note: previous" "" } */ /* { dg-warning "implicit" "implicit" { target *-*-* } 97 } */ } static int test8(int x) /* { dg-error "follows non-static" } */ { return x; } Index: gcc/testsuite/gcc.dg/pr36901.h =================================================================== --- gcc/testsuite/gcc.dg/pr36901.h (revision 0) +++ gcc/testsuite/gcc.dg/pr36901.h (revision 0) @@ -0,0 +1,2 @@ +#include +static int sc = INT_MAX + 1; Index: gcc/testsuite/gcc.dg/inline5.c =================================================================== --- gcc/testsuite/gcc.dg/inline5.c (revision 138311) +++ gcc/testsuite/gcc.dg/inline5.c (working copy) @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-Wall -std=gnu89" } */ /* This testcase should fail since we're redefining foo in the same translation unit. */ -extern inline int foo (void) { return 2; } /* { dg-error "previous definition of" } */ +extern inline int foo (void) { return 2; } /* { dg-message "note: previous definition of" } */ extern inline int foo (void) { return 1; } /* { dg-error "redefinition of" } */ Index: gcc/testsuite/gcc.dg/pr35899.c =================================================================== --- gcc/testsuite/gcc.dg/pr35899.c (revision 138311) +++ gcc/testsuite/gcc.dg/pr35899.c (working copy) @@ -3,11 +3,11 @@ /* { dg-options "-O2" } */ int foo (void) { - int a = bar (); /* { dg-warning "previous implicit declaration" } */ + int a = bar (); /* { dg-message "note: previous implicit declaration" } */ return a; } void bar (void) /* { dg-warning "conflicting types for" } */ Index: gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c =================================================================== --- gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c (working copy) @@ -2,11 +2,11 @@ by Kaveh R. Ghazi 8/23/2000. */ void foo(int i) { - my_label: /* { dg-error "previous definition" "prev label" } */ + my_label: /* { dg-message "note: previous definition" "prev label" } */ i++; my_label: /* { dg-error "duplicate label" "label lineno" } */ Index: gcc/testsuite/gcc.dg/noncompile/label-1.c =================================================================== --- gcc/testsuite/gcc.dg/noncompile/label-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/noncompile/label-1.c (working copy) @@ -26,19 +26,19 @@ void c(void) } /* can't have two labels with the same name in the same function */ void d(void) { - l: dummy(); /* { dg-error "previous definition" "prev def same scope" } */ + l: dummy(); /* { dg-message "note: previous definition" "prev def same scope" } */ l: dummy(); /* { dg-error "duplicate label" "dup label same scope" } */ goto l; } /* even at different scopes */ void e(void) { - l: dummy(); /* { dg-error "previous definition" "prev def diff scope" } */ + l: dummy(); /* { dg-message "note: previous definition" "prev def diff scope" } */ { l: dummy(); /* { dg-error "duplicate label" "dup label diff scope" } */ } goto l; } @@ -148,11 +148,11 @@ void m(void) /* and that means the nested function cannot have its own label with the same name as an outer label declared with __label__ */ void n(void) { - __label__ l; /* { dg-error "previous declaration" "outer label decl" } */ + __label__ l; /* { dg-message "note: previous declaration" "outer label decl" } */ void nest(void) { l: goto l; /* { dg-error "duplicate label" "inner label defn" } */ } Index: gcc/testsuite/gcc.dg/noncompile/20020220-1.c =================================================================== --- gcc/testsuite/gcc.dg/noncompile/20020220-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/noncompile/20020220-1.c (working copy) @@ -4,9 +4,9 @@ int foo (const char*, const char*); void bar (void) { const char *s = "bar"; - int i; /* { dg-error "previous declaration" } */ + int i; /* { dg-message "note: previous declaration" } */ int size = 2; int i = foo (s, s + size); /* { dg-error "redeclaration of" } */ } Index: gcc/testsuite/gcc.dg/noncompile/redecl-1.c =================================================================== --- gcc/testsuite/gcc.dg/noncompile/redecl-1.c (revision 138311) +++ gcc/testsuite/gcc.dg/noncompile/redecl-1.c (working copy) @@ -2,8 +2,8 @@ /* by Alexandre Oliva */ int foo () { - int bar; /* { dg-error "previous.*decl" "previous.*decl" } */ + int bar; /* { dg-message "note: previous.*decl" "previous.*decl" } */ volatile int bar; /* { dg-error "conflicting type qualifiers" "conflicting type qualifiers" } */ } Index: gcc/testsuite/gcc.dg/redecl-5.c =================================================================== --- gcc/testsuite/gcc.dg/redecl-5.c (revision 138311) +++ gcc/testsuite/gcc.dg/redecl-5.c (working copy) @@ -5,11 +5,11 @@ /* { dg-options "-std=c89" } */ void f (void) { - long z(); /* { dg-error "previous implicit declaration" } */ + long z(); /* { dg-message "note: previous implicit declaration" } */ } void g (void) { Index: gcc/testsuite/gcc.dg/qual-return-3.c =================================================================== --- gcc/testsuite/gcc.dg/qual-return-3.c (revision 138311) +++ gcc/testsuite/gcc.dg/qual-return-3.c (working copy) @@ -4,11 +4,11 @@ /* Origin: Joseph Myers */ /* { dg-do compile } */ /* { dg-options "" } */ -int foo (); /* { dg-error "previous declaration" "different qualifiers" } */ +int foo (); /* { dg-message "note: previous declaration" "different qualifiers" } */ const int foo () { return 0; } /* { dg-error "conflicting types" "different qualifiers" } */ void bar (void); volatile void bar () { } /* { dg-warning "qualified|volatile" "different qualifiers" } */ Index: gcc/testsuite/gcc.dg/label-decl-4.c =================================================================== --- gcc/testsuite/gcc.dg/label-decl-4.c (revision 138311) +++ gcc/testsuite/gcc.dg/label-decl-4.c (working copy) @@ -5,10 +5,10 @@ void f (void) { __label__ a, b, a; /* { dg-error "duplicate label declaration 'a'" } */ - /* { dg-error "previous declaration of 'a' was here" "previous" { target *-*-* } 9 } */ - __label__ c; /* { dg-error "previous declaration of 'c' was here" } */ + /* { dg-message "note: previous declaration of 'a' was here" "previous" { target *-*-* } 9 } */ + __label__ c; /* { dg-message "note: previous declaration of 'c' was here" } */ __label__ c; /* { dg-error "duplicate label declaration 'c'" } */ return; }