summaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.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/decl.c
parent68442471f096268699dec9a035e77a158e84cfc6 (diff)
downloadgcc-bf79c656554d78a01d1bcc1b3f227ee9f2e110ef.tar.gz
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/decl.c')
-rw-r--r--gcc/fortran/decl.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 45e5b6c2cd9..e7c06f3855b 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -898,17 +898,17 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry)
&& sym->attr.proc != 0
&& (sym->attr.subroutine || sym->attr.function)
&& sym->attr.if_source != IFSRC_UNKNOWN)
- gfc_error_now ("Procedure '%s' at %C is already defined at %L",
- name, &sym->declared_at);
+ gfc_error_now_1 ("Procedure '%s' at %C is already defined at %L",
+ name, &sym->declared_at);
/* Trap a procedure with a name the same as interface in the
encompassing scope. */
if (sym->attr.generic != 0
&& (sym->attr.subroutine || sym->attr.function)
&& !sym->attr.mod_proc)
- gfc_error_now ("Name '%s' at %C is already defined"
- " as a generic interface at %L",
- name, &sym->declared_at);
+ gfc_error_now_1 ("Name '%s' at %C is already defined"
+ " as a generic interface at %L",
+ name, &sym->declared_at);
/* Trap declarations of attributes in encompassing scope. The
signature for this is that ts.kind is set. Legitimate
@@ -919,9 +919,9 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry)
&& gfc_current_ns->parent != NULL
&& sym->attr.access == 0
&& !module_fcn_entry)
- gfc_error_now ("Procedure '%s' at %C has an explicit interface "
- "and must not have attributes declared at %L",
- name, &sym->declared_at);
+ gfc_error_now_1 ("Procedure '%s' at %C has an explicit interface "
+ "and must not have attributes declared at %L",
+ name, &sym->declared_at);
}
if (gfc_current_ns->parent == NULL || *result == NULL)
@@ -990,9 +990,9 @@ gfc_verify_c_interop_param (gfc_symbol *sym)
{
if (sym->attr.is_bind_c == 0)
{
- gfc_error_now_2 ("Procedure %qs at %L must have the BIND(C) "
- "attribute to be C interoperable", sym->name,
- &(sym->declared_at));
+ gfc_error_now ("Procedure %qs at %L must have the BIND(C) "
+ "attribute to be C interoperable", sym->name,
+ &(sym->declared_at));
return false;
}
else
@@ -1029,7 +1029,7 @@ gfc_verify_c_interop_param (gfc_symbol *sym)
"because it is polymorphic",
sym->name, &(sym->declared_at),
sym->ns->proc_name->name);
- else if (gfc_option.warn_c_binding_type)
+ else if (warn_c_binding_type)
gfc_warning ("Variable '%s' at %L is a dummy argument of the "
"BIND(C) procedure '%s' but may not be C "
"interoperable",
@@ -1182,9 +1182,9 @@ build_sym (const char *name, gfc_charlen *cl, bool cl_deferred,
if (sym->common_block != NULL && sym->common_block->is_bind_c == 1
&& sym->ts.is_c_interop != 1)
{
- gfc_error_now ("Variable '%s' in common block '%s' at %C "
+ gfc_error_now ("Variable %qs in common block %qs at %C "
"must be declared with a C interoperable "
- "kind since common block '%s' is BIND(C)",
+ "kind since common block %qs is BIND(C)",
sym->name, sym->common_block->name,
sym->common_block->name);
gfc_clear_error ();
@@ -1224,9 +1224,9 @@ gfc_set_constant_character_len (int len, gfc_expr *expr, int check_len)
gfc_wide_memset (&s[slen], ' ', len - slen);
if (warn_character_truncation && slen > len)
- gfc_warning_now_2 (OPT_Wcharacter_truncation,
- "CHARACTER expression at %L is being truncated "
- "(%d/%d)", &expr->where, slen, len);
+ gfc_warning_now (OPT_Wcharacter_truncation,
+ "CHARACTER expression at %L is being truncated "
+ "(%d/%d)", &expr->where, slen, len);
/* Apply the standard by 'hand' otherwise it gets cleared for
initializers. */
@@ -4029,7 +4029,7 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
{
tmp_sym = tmp_sym->result;
/* Make sure it wasn't an implicitly typed result. */
- if (tmp_sym->attr.implicit_type && gfc_option.warn_c_binding_type)
+ if (tmp_sym->attr.implicit_type && warn_c_binding_type)
{
gfc_warning ("Implicitly declared BIND(C) function '%s' at "
"%L may not be C interoperable", tmp_sym->name,
@@ -4050,7 +4050,7 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
if (!gfc_verify_c_interop (&(tmp_sym->ts)))
{
/* See if we're dealing with a sym in a common block or not. */
- if (is_in_common == 1 && gfc_option.warn_c_binding_type)
+ if (is_in_common == 1 && warn_c_binding_type)
{
gfc_warning ("Variable '%s' in common block '%s' at %L "
"may not be a C interoperable "
@@ -4064,7 +4064,7 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
gfc_error ("Type declaration '%s' at %L is not C "
"interoperable but it is BIND(C)",
tmp_sym->name, &(tmp_sym->declared_at));
- else if (gfc_option.warn_c_binding_type)
+ else if (warn_c_binding_type)
gfc_warning ("Variable '%s' at %L "
"may not be a C interoperable "
"kind but it is bind(c)",
@@ -4130,8 +4130,8 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
&& tmp_sym->binding_label)
/* Use gfc_warning_now because we won't say that the symbol fails
just because of this. */
- gfc_warning_now ("Symbol '%s' at %L is marked PRIVATE but has been "
- "given the binding label '%s'", tmp_sym->name,
+ gfc_warning_now ("Symbol %qs at %L is marked PRIVATE but has been "
+ "given the binding label %qs", tmp_sym->name,
&(tmp_sym->declared_at), tmp_sym->binding_label);
return retval;