Commit f4031599 by Tobias Burnus Committed by Tobias Burnus

error.c (warnings_not_errors): Use bool.

2014-12-02  Tobias Burnus  <burnus@net-b.de>
            Manuel López-Ibáñez  <manu@gcc.gnu.org>

        * error.c (warnings_not_errors): Use bool.
        (gfc_clear_error): Update.
        (gfc_get_errors): Ditto. Use bool argument.
        * gfortran.h (gfc_get_errors): Update prototype.
        * resolve.c (resolve_global_procedure): Update call.


Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>

From-SVN: r218296
parent 7f9283bf
2014-12-02 Tobias Burnus <burnus@net-b.de>
Manuel López-Ibáñez <manu@gcc.gnu.org>
* error.c (warnings_not_errors): Use bool.
(gfc_clear_error): Update.
(gfc_get_errors): Ditto. Use bool argument.
* gfortran.h (gfc_get_errors): Update prototype.
* resolve.c (resolve_global_procedure): Update call.
2014-12-02 Richard Biener <rguenther@suse.de> 2014-12-02 Richard Biener <rguenther@suse.de>
PR fortran/64137 PR fortran/64137
......
...@@ -44,7 +44,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -44,7 +44,7 @@ along with GCC; see the file COPYING3. If not see
static int suppress_errors = 0; static int suppress_errors = 0;
static int warnings_not_errors = 0; static bool warnings_not_errors = false;
static int terminal_width, buffer_flag, errors, warnings; static int terminal_width, buffer_flag, errors, warnings;
...@@ -1302,7 +1302,7 @@ void ...@@ -1302,7 +1302,7 @@ void
gfc_clear_error (void) gfc_clear_error (void)
{ {
error_buffer.flag = 0; error_buffer.flag = 0;
warnings_not_errors = 0; warnings_not_errors = false;
} }
...@@ -1395,9 +1395,9 @@ gfc_get_errors (int *w, int *e) ...@@ -1395,9 +1395,9 @@ gfc_get_errors (int *w, int *e)
/* Switch errors into warnings. */ /* Switch errors into warnings. */
void void
gfc_errors_to_warnings (int f) gfc_errors_to_warnings (bool f)
{ {
warnings_not_errors = (f == 1) ? 1 : 0; warnings_not_errors = f;
} }
void void
......
...@@ -2701,7 +2701,7 @@ void gfc_pop_error (gfc_error_buf *); ...@@ -2701,7 +2701,7 @@ void gfc_pop_error (gfc_error_buf *);
void gfc_free_error (gfc_error_buf *); void gfc_free_error (gfc_error_buf *);
void gfc_get_errors (int *, int *); void gfc_get_errors (int *, int *);
void gfc_errors_to_warnings (int); void gfc_errors_to_warnings (bool);
/* arith.c */ /* arith.c */
void gfc_arith_init_1 (void); void gfc_arith_init_1 (void);
......
...@@ -2431,7 +2431,7 @@ resolve_global_procedure (gfc_symbol *sym, locus *where, ...@@ -2431,7 +2431,7 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
if (!pedantic && (gfc_option.allow_std & GFC_STD_GNU)) if (!pedantic && (gfc_option.allow_std & GFC_STD_GNU))
/* Turn erros into warnings with -std=gnu and -std=legacy. */ /* Turn erros into warnings with -std=gnu and -std=legacy. */
gfc_errors_to_warnings (1); gfc_errors_to_warnings (true);
if (!gfc_compare_interfaces (sym, def_sym, sym->name, 0, 1, if (!gfc_compare_interfaces (sym, def_sym, sym->name, 0, 1,
reason, sizeof(reason), NULL, NULL)) reason, sizeof(reason), NULL, NULL))
...@@ -2444,14 +2444,14 @@ resolve_global_procedure (gfc_symbol *sym, locus *where, ...@@ -2444,14 +2444,14 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
if (!pedantic if (!pedantic
|| ((gfc_option.warn_std & GFC_STD_LEGACY) || ((gfc_option.warn_std & GFC_STD_LEGACY)
&& !(gfc_option.warn_std & GFC_STD_GNU))) && !(gfc_option.warn_std & GFC_STD_GNU)))
gfc_errors_to_warnings (1); gfc_errors_to_warnings (true);
if (sym->attr.if_source != IFSRC_IFBODY) if (sym->attr.if_source != IFSRC_IFBODY)
gfc_procedure_use (def_sym, actual, where); gfc_procedure_use (def_sym, actual, where);
} }
done: done:
gfc_errors_to_warnings (0); gfc_errors_to_warnings (false);
if (gsym->type == GSYM_UNKNOWN) if (gsym->type == GSYM_UNKNOWN)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment