+2014-12-06 Tobias Burnus <burnus@net-b.de>
+
+ * error.c (gfc_error_check): Use bool not int.
+ * gfortran.h (gfc_error_check): Update prototype.
+ * match.c (gfc_match_if): Update call.
+ * parse.c (decode_statement, decode_omp_directive,
+ decode_gcc_attribute): Ditto.
+
2014-12-06 Tobias Burnus <burnus@net-b.de>
Manuel López-Ibáñez <manu@gcc.gnu.org>
/* Check to see if any errors have been saved.
If so, print the error. Returns the state of error_flag. */
-int
+bool
gfc_error_check (void)
{
- int rc;
-
- rc = error_buffer.flag;
+ bool error_raised = (bool) error_buffer.flag;
- if (error_buffer.flag)
+ if (error_raised)
{
if (error_buffer.message != NULL)
fputs (error_buffer.message, stderr);
exit (FATAL_EXIT_CODE);
}
- return rc;
+ return error_raised;
}
void gfc_fatal_error (const char *, ...) ATTRIBUTE_NORETURN ATTRIBUTE_GCC_GFC(1,2);
void gfc_internal_error (const char *, ...) ATTRIBUTE_NORETURN ATTRIBUTE_GCC_GFC(1,2);
void gfc_clear_error (void);
-int gfc_error_check (void);
+bool gfc_error_check (void);
bool gfc_error_flag_test (void);
notification gfc_notification_std (int);
/* All else has failed, so give up. See if any of the matchers has
stored an error message of some sort. */
- if (gfc_error_check () == 0)
+ if (!gfc_error_check ())
gfc_error ("Unclassifiable statement in IF-clause at %C");
gfc_free_expr (expr);
/* All else has failed, so give up. See if any of the matchers has
stored an error message of some sort. */
- if (gfc_error_check () == 0)
+ if (!gfc_error_check ())
gfc_error_now ("Unclassifiable statement at %C");
reject_statement ();
if (gfc_option.gfc_flag_openmp || simd_matched)
{
- if (gfc_error_check () == 0)
+ if (!gfc_error_check ())
gfc_error_now ("Unclassifiable OpenMP directive at %C");
}
/* All else has failed, so give up. See if any of the matchers has
stored an error message of some sort. */
- if (gfc_error_check () == 0)
+ if (!gfc_error_check ())
gfc_error_now ("Unclassifiable GCC directive at %C");
reject_statement ();