PR 42965
* diagnostic.c (diagnostic_initialize): Initialize
some_warnings_are_errors.
(diagnostic_finish): New.
(diagnostic_action_after_output): Call it before exiting.
(diagnostic_report_diagnostic): Do not print message here. Set
some_warnings_are_errors.
* diagnostic.h (diagnostic_context): Delete
issue_warnings_are_errors_message. Add some_warnings_are_errors.
(diagnostic_finish): Declare.
* toplev.c (toplev_main): Call it before exit.
testsuite/
* gcc.dg/Werror-6.c: Adjust.
* gcc.dg/Werror-implicit-function-declaration.c: Likewise.
* gcc.dg/Werror-4.c: Likewise.
* gcc.dg/Wdeclaration-after-statement-3.c: Likewise.
* gcc.dg/Wswitch-enum-error.c: Likewise.
* gcc.dg/Wpointer-arith.c: Likewise.
* gcc.dg/Wfatal.c: Likewise.
* gcc.dg/Wswitch-error.c: Likewise.
* g++.dg/warn/unused-result1-Werror.c: Likewise.
* gcc.dg/Werror-9.c: Delete. Duplicate of Werror-4.c.
* gcc.dg/cpp/warn-undef-2.c: Likewise.
* gcc.dg/cpp/warn-traditional-2.c: Likewise.
* gcc.dg/cpp/warn-comments-2.c: Likewise.
* gcc.dg/cpp/warn-variadic-2.c: Likewise.
* gcc.dg/cpp/warning-directive-2.c: Likewise.
* gcc.dg/cpp/warn-long-long-2.c: Likewise.
* gcc.dg/cpp/warn-deprecated-2.c: Likewise.
* gcc.dg/cpp/warn-multichar-2.c: Likewise.
* gcc.dg/cpp/warn-normalized-3.c: Likewise.
* gcc.dg/cpp/warn-cxx-compat-2.c: Likewise.
* gcc.dg/cpp/warn-trigraphs-3.c: Likewise.
* gcc.dg/cpp/warn-unused-macros-2.c: Likewise.
* gcc.dg/cpp/warn-trigraphs-4.c: Likewise.
* gcc.dg/cpp/warn-redefined-2.c: Likewise.
* g++.dg/cpp/warning-directive-2.C: Likewise.
* gfortran.dg/warning-directive-2.F90: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158168
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR 42965
+ * diagnostic.c (diagnostic_initialize): Initialize
+ some_warnings_are_errors.
+ (diagnostic_finish): New.
+ (diagnostic_action_after_output): Call it before exiting.
+ (diagnostic_report_diagnostic): Do not print message here. Set
+ some_warnings_are_errors.
+ * diagnostic.h (diagnostic_context): Delete
+ issue_warnings_are_errors_message. Add some_warnings_are_errors.
+ (diagnostic_finish): Declare.
+ * toplev.c (toplev_main): Call it before exit.
+
2010-04-09 Jason Merrill <jason@redhat.com>
PR c++/42623
+2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR 42965
+ * gcc.dg/Werror-6.c: Adjust.
+ * gcc.dg/Werror-implicit-function-declaration.c: Likewise.
+ * gcc.dg/Werror-4.c: Likewise.
+ * gcc.dg/Wdeclaration-after-statement-3.c: Likewise.
+ * gcc.dg/Wswitch-enum-error.c: Likewise.
+ * gcc.dg/Wpointer-arith.c: Likewise.
+ * gcc.dg/Wfatal.c: Likewise.
+ * gcc.dg/Wswitch-error.c: Likewise.
+ * g++.dg/warn/unused-result1-Werror.c: Likewise.
+ * gcc.dg/Werror-9.c: Delete. Duplicate of Werror-4.c.
+ * gcc.dg/cpp/warn-undef-2.c: Likewise.
+ * gcc.dg/cpp/warn-traditional-2.c: Likewise.
+ * gcc.dg/cpp/warn-comments-2.c: Likewise.
+ * gcc.dg/cpp/warn-variadic-2.c: Likewise.
+ * gcc.dg/cpp/warning-directive-2.c: Likewise.
+ * gcc.dg/cpp/warn-long-long-2.c: Likewise.
+ * gcc.dg/cpp/warn-deprecated-2.c: Likewise.
+ * gcc.dg/cpp/warn-multichar-2.c: Likewise.
+ * gcc.dg/cpp/warn-normalized-3.c: Likewise.
+ * gcc.dg/cpp/warn-cxx-compat-2.c: Likewise.
+ * gcc.dg/cpp/warn-trigraphs-3.c: Likewise.
+ * gcc.dg/cpp/warn-unused-macros-2.c: Likewise.
+ * gcc.dg/cpp/warn-trigraphs-4.c: Likewise.
+ * gcc.dg/cpp/warn-redefined-2.c: Likewise.
+ * g++.dg/cpp/warning-directive-2.C: Likewise.
+ * gfortran.dg/warning-directive-2.F90: Likewise.
+
2010-04-09 Jason Merrill <jason@redhat.com>
PR c++/42623
// { dg-do preprocess }
// { dg-options "-fdiagnostics-show-option -Werror=cpp" }
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
#warning "Printed" // { dg-error "\"Printed\" .-Wcpp." }
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-Waddress -Wattributes" } */
-
-/* Make sure the command line option enables the warning. */
-
-void __attribute__((dj)) bar() { } /* { dg-warning ".* attribute directive ignored" } */
-
-int i;
-
-void
-foo ()
-{
- if (&i) /* { dg-warning ".* will always evaluate as 'true'" } */
- grill ();
-}
// { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=comments" }
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
/* /* */ // { dg-error "\"\.\*\" within comment .-Wcomments." }
// \
// { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=c++-compat" }
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
#define not ! // { dg-error "identifier \"not\" is a special operator name in C\\+\\+ .-Wc\\+\\+-compat." }
// { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=deprecated" }
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
#assert x(x) // { dg-error "#assert is a deprecated GCC extension .-Wdeprecated." }
#if #x(x) // { dg-error "assertions are a deprecated extension .-Wdeprecated." }
// { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wtraditional -Werror=long-long" }
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
#if 0LL // { dg-error "traditional C rejects the \"LL\" suffix .-Wlong-long." }
// { dg-error "use of C99 long long integer constant .-Wlong-long." "use long long" { target *-*-* } 4 }
#endif
// { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=multichar" }
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
#if 'abc' // { dg-error "multi-character character constant .-Wmultichar." }
#endif
// { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -fextended-identifiers -Werror=normalized=" }
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
// { dg-prune-output ".*-Werror=normalized=: Set -Wnormalized=nfc.*" }
\u0F43 // { dg-error "`.U00000f43' is not in NFC .-Wnormalized=." }
// { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=builtin-macro-redefined" }
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
#ifndef __TIME__
#error "__TIME__ builtin is not defined"
// { dg-bogus "__TIME__ builtin is not defined" "no-time" { target *-*-* } 5 }
// { dg-do compile }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=traditional -Wno-deprecated -Wno-long-long" }
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
#assert x(x) // { dg-error "suggest hiding #assert from traditional C with an indented # .-Wtraditional." }
#define X X // { dg-error "traditional C ignores #define with the # indented .-Wtraditional." }
// { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -trigraphs -Werror=trigraphs" }
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
??= // { dg-error "trigraph \\?\\?= converted to # .-Wtrigraphs." }
// { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=trigraphs" }
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
??= // { dg-error "trigraph \\?\\?= ignored, use -trigraphs to enable .-Wtrigraphs." }
// { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=undef" }
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
#if x // { dg-error "\"x\" is not defined .-Wundef." }
#endif
// { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=unused-macros" }
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
#define X X // { dg-error "macro \"X\" is not used .-Wunused-macros." }
/* { dg-do preprocess } */
/* { dg-options "-ansi -fdiagnostics-show-option -pedantic -Werror=variadic-macros" } */
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
#define F(...) X /* { dg-error "anonymous variadic macros were introduced in C99 .-Wvariadic-macros." } */
#define G(X...) X /* { dg-error "ISO C does not permit named variadic macros .-Wvariadic-macros." } */
// { dg-do preprocess }
// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=cpp" }
-
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
#warning "Printed" // { dg-error "\"Printed\" .-Wcpp." }
! { dg-do preprocess }
! { dg-options "-std=f95 -fdiagnostics-show-option -Werror=cpp" }
-
+! { dg-warning "some warnings being treated as errors" "" {target "*-*-*"} 0 }
#warning "Printed"
! { dg-error "\"Printed\" .-Wcpp." "" { target *-*-* } 4 }