re PR fortran/21061 (gfortran ignores -Werror)

2006-11-05  Bernhard Fischer  <aldot@gcc.gnu.org>

        PR fortran/21061
        * error.c (gfc_warning): If warnings_are_errors then treat
        warnings as errors with respect to the exit code.
        (gfc_notify_std): Ditto.
        (gfc_warning_now): Ditto.

From-SVN: r118501
This commit is contained in:
Bernhard Fischer 2006-11-05 15:57:24 +01:00 committed by Bernhard Reutner-Fischer
parent 7945be3f19
commit f4d4085c10
2 changed files with 20 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2006-11-05 Bernhard Fischer <aldot@gcc.gnu.org>
PR fortran/21061
* error.c (gfc_warning): If warnings_are_errors then treat
warnings as errors with respect to the exit code.
(gfc_notify_std): Ditto.
(gfc_warning_now): Ditto.
2006-11-05 Francois-Xavier Coudert <fxcoudert@gcc.gnu,org>
Paul Thomas <pault@gcc.gnu.org>

View File

@ -476,7 +476,12 @@ gfc_warning (const char *nocmsgid, ...)
va_start (argp, nocmsgid);
if (buffer_flag == 0)
{
warnings++;
if (warnings_are_errors)
errors++;
}
error_print (_("Warning:"), _(nocmsgid), argp);
va_end (argp);
@ -519,14 +524,15 @@ gfc_notify_std (int std, const char *nocmsgid, ...)
if (gfc_suppress_error)
return warning ? SUCCESS : FAILURE;
cur_error_buffer = warning ? &warning_buffer : &error_buffer;
cur_error_buffer = (warning && !warnings_are_errors)
? &warning_buffer : &error_buffer;
cur_error_buffer->flag = 1;
cur_error_buffer->index = 0;
if (buffer_flag == 0)
{
if (warning)
if (warning && !warnings_are_errors)
warnings++;
else
errors++;
@ -539,7 +545,7 @@ gfc_notify_std (int std, const char *nocmsgid, ...)
va_end (argp);
error_char ('\0');
return warning ? SUCCESS : FAILURE;
return (warning && !warnings_are_errors) ? SUCCESS : FAILURE;
}
@ -557,6 +563,8 @@ gfc_warning_now (const char *nocmsgid, ...)
i = buffer_flag;
buffer_flag = 0;
warnings++;
if (warnings_are_errors)
errors++;
va_start (argp, nocmsgid);
error_print (_("Warning:"), _(nocmsgid), argp);