summaryrefslogtreecommitdiff
path: root/gcc/fortran/error.c
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-25 22:33:32 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-25 22:33:32 +0000
commitbf79c656554d78a01d1bcc1b3f227ee9f2e110ef (patch)
tree473bf73756e4b0fb99262902721646ab2e7d2c49 /gcc/fortran/error.c
parent68442471f096268699dec9a035e77a158e84cfc6 (diff)
2014-11-25 Tobias Burnus <burnus@net-b.de>
gcc/fortran/ * gfortran.h (gfc_option_t): Remove flags moved as Var to .opt. (gfc_error_now_1): Renamed from gfc_error_now. (gfc_error_now): Renamed from gfc_error_now_2. (gfc_warning_now_1): Renamed from gfc_warning_now. (gfc_warning_now): Renamed from gfc_warning_now_2. * error.c (gfc_error_now_1): Renamed from gfc_error_now. (gfc_error_now): Renamed from gfc_error_now_2. (gfc_warning_now_1): Renamed from gfc_warning_now. (gfc_warning_now): Renamed from gfc_warning_now_2. (gfc_get_errors): Include common diagnostic in count. * lang.opt (Wc-binding-type, Wconversion, Wconversion-extra, Wintrinsics-std): Create a Var for those warnings. * check.c (gfc_check_cmplx): Pass warning flag to diagnostic function. * decl.c (get_proc_name, gfc_verify_c_interop_param, build_sym gfc_set_constant_character_len, verify_bind_c_sym): Ditto; use _1 for old diagnostic, remove _2 for new diagnostic. * expr.c (gfc_check_assign, gfc_check_vardef_context): Ditto. * frontend-passes.c (doloop_code, do_function): Ditto. * intrinsic.c (gfc_is_intrinsic, gfc_convert_type_warn): Ditto. * match.c (gfc_match_common): Ditto. * module.c (use_iso_fortran_env_module, gfc_use_module): Ditto. * parse.c (decode_statement, decode_gcc_attribute, next_free, next_fixed, gfc_check_do_variable): Ditto. * resolve.c (resolve_common_vars, resolve_ordinary_assign): Ditto. * scanner.c (add_path_to_list, skip_free_comments, gfc_next_char_literal, gfc_gobble_whitespace, load_line, preprocessor_line, load_file): Ditto. * symbol.c (gfc_set_default_type, verify_bind_c_derived_type): Ditto. * options.c (gfc_post_options): Ditto. (gfc_init_options, set_Wall, gfc_handle_option): Ditto; remove flags which now have a Var. * invoke.texi (Wconversion-extra): Make clear that the flag does not imply -Wconversion. gcc/testsuite/ * gfortran.dg/empty_label.f: Change test to continue testing for -fmax-errors=1. * gfortran.dg/empty_label.f90: Ditto. * gfortran.dg/warnings_are_errors_1.f90: Update dg-*. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218067 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/error.c')
-rw-r--r--gcc/fortran/error.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index 202dd88fd4f3..a0ad2ad9c71f 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -933,10 +933,11 @@ gfc_notify_std (int std, const char *gmsgid, ...)
/* Immediate warning (i.e. do not buffer the warning). */
-/* Use gfc_warning_now_2 instead, unless gmsgid contains a %L. */
+/* Use gfc_warning_now instead, unless two locations are used in the same
+ warning or for scanner.c, if the location is not properly set up. */
void
-gfc_warning_now (const char *gmsgid, ...)
+gfc_warning_now_1 (const char *gmsgid, ...)
{
va_list argp;
int i;
@@ -1094,10 +1095,12 @@ gfc_diagnostic_finalizer (diagnostic_context *context,
}
/* Immediate warning (i.e. do not buffer the warning). */
-/* This function uses the common diagnostics, but does not support %L, yet. */
+/* This function uses the common diagnostics, but does not support
+ two locations; when being used in scanner.c, ensure that the location
+ is properly setup. Otherwise, use gfc_warning_now_1. */
bool
-gfc_warning_now_2 (int opt, const char *gmsgid, ...)
+gfc_warning_now (int opt, const char *gmsgid, ...)
{
va_list argp;
diagnostic_info diagnostic;
@@ -1113,10 +1116,12 @@ gfc_warning_now_2 (int opt, const char *gmsgid, ...)
}
/* Immediate warning (i.e. do not buffer the warning). */
-/* This function uses the common diagnostics, but does not support %L, yet. */
+/* This function uses the common diagnostics, but does not support
+ two locations; when being used in scanner.c, ensure that the location
+ is properly setup. Otherwise, use gfc_warning_now_1. */
bool
-gfc_warning_now_2 (const char *gmsgid, ...)
+gfc_warning_now (const char *gmsgid, ...)
{
va_list argp;
diagnostic_info diagnostic;
@@ -1132,10 +1137,12 @@ gfc_warning_now_2 (const char *gmsgid, ...)
/* Immediate error (i.e. do not buffer). */
-/* This function uses the common diagnostics, but does not support %L, yet. */
+/* This function uses the common diagnostics, but does not support
+ two locations; when being used in scanner.c, ensure that the location
+ is properly setup. Otherwise, use gfc_error_now_1. */
void
-gfc_error_now_2 (const char *gmsgid, ...)
+gfc_error_now (const char *gmsgid, ...)
{
va_list argp;
diagnostic_info diagnostic;
@@ -1241,10 +1248,11 @@ warning:
/* Immediate error. */
-/* Use gfc_error_now_2 instead, unless gmsgid contains a %L. */
+/* Use gfc_error_now instead, unless two locations are used in the same
+ warning or for scanner.c, if the location is not properly set up. */
void
-gfc_error_now (const char *gmsgid, ...)
+gfc_error_now_1 (const char *gmsgid, ...)
{
va_list argp;
int i;
@@ -1382,9 +1390,9 @@ void
gfc_get_errors (int *w, int *e)
{
if (w != NULL)
- *w = warnings;
+ *w = warnings + warningcount + werrorcount;
if (e != NULL)
- *e = errors;
+ *e = errors + errorcount + sorrycount + werrorcount;
}