diff options
author | Janus Weil <janus@gcc.gnu.org> | 2012-07-17 23:51:20 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2012-07-17 23:51:20 +0200 |
commit | 9717f7a145b447c2c3dd00601de66be20d86261e (patch) | |
tree | febd4dbe9cfa04d1ec5bd70ba1e7499e1bead258 | |
parent | 697c474c8fadce131f79b662a79a454959d02c39 (diff) | |
download | gcc-9717f7a145b447c2c3dd00601de66be20d86261e.tar.gz |
re PR fortran/51081 ([F03] Proc-pointer assignment: Rejects valid internal proc)
2012-07-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/51081
* error.c (gfc_notify_std): Automatically print the relevant Fortran
standard version.
* arith.c (arith_power): Remove explicit standard reference string.
* array.c (gfc_match_array_spec, gfc_match_array_constructor): Ditto.
* check.c (gfc_check_a_p, gfc_check_besn, gfc_check_count,
gfc_check_float, gfc_check_fn_rc2008, gfc_check_iand,
gfc_check_ichar_iachar, gfc_check_ieor, gfc_check_index, gfc_check_ior,
gfc_check_lbound, gfc_check_len_lentrim, check_rest, gfc_check_min_max,
gfc_check_null, gfc_check_scan, gfc_check_selected_real_kind,
gfc_check_shape, gfc_check_size, gfc_check_sngl, gfc_check_ubound,
gfc_check_verify): Ditto.
* data.c (gfc_assign_data_value): Ditto.
* decl.c (var_element, char_len_param_value, match_char_length,
gfc_verify_c_interop_param, match_pointer_init, variable_decl,
gfc_match_decl_type_spec, gfc_match_import, match_attr_spec,
gfc_match_prefix, gfc_match_suffix, match_ppc_decl,
match_procedure_in_interface, gfc_match_procedure,gfc_match_entry,
gfc_match_subroutine, gfc_match_end, gfc_match_codimension,
gfc_match_protected, gfc_match_value, gfc_match_volatile,
gfc_match_asynchronous, gfc_match_modproc, gfc_get_type_attr_spec,
gfc_match_enum, match_procedure_in_type): Ditto.
* expr.c (check_elemental, gfc_check_assign, gfc_check_pointer_assign):
Ditto.
* interface.c (gfc_match_abstract_interface, check_interface0): Ditto.
* intrinsic.c (gfc_intrinsic_func_interface): Ditto.
* io.c (format_lex, resolve_tag_format, resolve_tag,
compare_to_allowed_values, gfc_match_open, gfc_match_rewind,
gfc_resolve_dt, gfc_match_wait): Ditto.
* match.c (match_arithmetic_if, gfc_match_if, gfc_match_critical,
gfc_match_do, match_exit_cycle, gfc_match_pause, gfc_match_stop,
gfc_match_lock, sync_statement, gfc_match_assign, gfc_match_goto,
gfc_match_allocate, gfc_match_return, gfc_match_st_function): Ditto.
* module.c (gfc_match_use, gfc_use_module): Ditto.
* parse.c (parse_derived_contains, parse_block_construct,
parse_associate, parse_contained): Ditto.
* primary.c (match_hollerith_constant, match_boz_constant,
match_real_constant, match_sym_complex_part, match_arg_list_function,
build_actual_constructor, gfc_convert_to_structure_constructor): Ditto.
* resolve.c (resolve_formal_arglist, resolve_entries,
resolve_common_blocks, resolve_actual_arglist, gfc_resolve_index_1,
gfc_resolve_iterator_expr, resolve_ordinary_assign,
resolve_fl_var_and_proc, resolve_fl_variable_derived,
resolve_fl_procedure, resolve_fl_derived0, resolve_fl_derived,
resolve_fl_namelist, resolve_symbol, resolve_fntype): Ditto.
* symbol.c (check_conflict, conflict, gfc_add_is_bind_c,
gfc_add_extension, gfc_check_symbol_typed): Ditto.
From-SVN: r189589
-rw-r--r-- | gcc/fortran/ChangeLog | 50 | ||||
-rw-r--r-- | gcc/fortran/arith.c | 4 | ||||
-rw-r--r-- | gcc/fortran/array.c | 8 | ||||
-rw-r--r-- | gcc/fortran/check.c | 46 | ||||
-rw-r--r-- | gcc/fortran/data.c | 4 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 80 | ||||
-rw-r--r-- | gcc/fortran/error.c | 45 | ||||
-rw-r--r-- | gcc/fortran/expr.c | 17 | ||||
-rw-r--r-- | gcc/fortran/interface.c | 4 | ||||
-rw-r--r-- | gcc/fortran/intrinsic.c | 4 | ||||
-rw-r--r-- | gcc/fortran/io.c | 62 | ||||
-rw-r--r-- | gcc/fortran/match.c | 44 | ||||
-rw-r--r-- | gcc/fortran/module.c | 10 | ||||
-rw-r--r-- | gcc/fortran/parse.c | 18 | ||||
-rw-r--r-- | gcc/fortran/primary.c | 18 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 50 | ||||
-rw-r--r-- | gcc/fortran/symbol.c | 12 |
17 files changed, 283 insertions, 193 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index dd7958bec81..0f5e403ceaa 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,53 @@ +2012-07-17 Janus Weil <janus@gcc.gnu.org> + + PR fortran/51081 + * error.c (gfc_notify_std): Automatically print the relevant Fortran + standard version. + * arith.c (arith_power): Remove explicit standard reference string. + * array.c (gfc_match_array_spec, gfc_match_array_constructor): Ditto. + * check.c (gfc_check_a_p, gfc_check_besn, gfc_check_count, + gfc_check_float, gfc_check_fn_rc2008, gfc_check_iand, + gfc_check_ichar_iachar, gfc_check_ieor, gfc_check_index, gfc_check_ior, + gfc_check_lbound, gfc_check_len_lentrim, check_rest, gfc_check_min_max, + gfc_check_null, gfc_check_scan, gfc_check_selected_real_kind, + gfc_check_shape, gfc_check_size, gfc_check_sngl, gfc_check_ubound, + gfc_check_verify): Ditto. + * data.c (gfc_assign_data_value): Ditto. + * decl.c (var_element, char_len_param_value, match_char_length, + gfc_verify_c_interop_param, match_pointer_init, variable_decl, + gfc_match_decl_type_spec, gfc_match_import, match_attr_spec, + gfc_match_prefix, gfc_match_suffix, match_ppc_decl, + match_procedure_in_interface, gfc_match_procedure,gfc_match_entry, + gfc_match_subroutine, gfc_match_end, gfc_match_codimension, + gfc_match_protected, gfc_match_value, gfc_match_volatile, + gfc_match_asynchronous, gfc_match_modproc, gfc_get_type_attr_spec, + gfc_match_enum, match_procedure_in_type): Ditto. + * expr.c (check_elemental, gfc_check_assign, gfc_check_pointer_assign): + Ditto. + * interface.c (gfc_match_abstract_interface, check_interface0): Ditto. + * intrinsic.c (gfc_intrinsic_func_interface): Ditto. + * io.c (format_lex, resolve_tag_format, resolve_tag, + compare_to_allowed_values, gfc_match_open, gfc_match_rewind, + gfc_resolve_dt, gfc_match_wait): Ditto. + * match.c (match_arithmetic_if, gfc_match_if, gfc_match_critical, + gfc_match_do, match_exit_cycle, gfc_match_pause, gfc_match_stop, + gfc_match_lock, sync_statement, gfc_match_assign, gfc_match_goto, + gfc_match_allocate, gfc_match_return, gfc_match_st_function): Ditto. + * module.c (gfc_match_use, gfc_use_module): Ditto. + * parse.c (parse_derived_contains, parse_block_construct, + parse_associate, parse_contained): Ditto. + * primary.c (match_hollerith_constant, match_boz_constant, + match_real_constant, match_sym_complex_part, match_arg_list_function, + build_actual_constructor, gfc_convert_to_structure_constructor): Ditto. + * resolve.c (resolve_formal_arglist, resolve_entries, + resolve_common_blocks, resolve_actual_arglist, gfc_resolve_index_1, + gfc_resolve_iterator_expr, resolve_ordinary_assign, + resolve_fl_var_and_proc, resolve_fl_variable_derived, + resolve_fl_procedure, resolve_fl_derived0, resolve_fl_derived, + resolve_fl_namelist, resolve_symbol, resolve_fntype): Ditto. + * symbol.c (check_conflict, conflict, gfc_add_is_bind_c, + gfc_add_extension, gfc_check_symbol_typed): Ditto. + 2012-07-17 Tobias Burnus <burnus@net-b.de> PR fortran/53985 diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c index 38ba2711d12..6fa7c70fe9c 100644 --- a/gcc/fortran/arith.c +++ b/gcc/fortran/arith.c @@ -903,7 +903,7 @@ arith_power (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) if (gfc_init_expr_flag) { - if (gfc_notify_std (GFC_STD_F2003,"Fortran 2003: Noninteger " + if (gfc_notify_std (GFC_STD_F2003, "Noninteger " "exponent in an initialization " "expression at %L", &op2->where) == FAILURE) return ARITH_PROHIBIT; @@ -925,7 +925,7 @@ arith_power (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp) { if (gfc_init_expr_flag) { - if (gfc_notify_std (GFC_STD_F2003,"Fortran 2003: Noninteger " + if (gfc_notify_std (GFC_STD_F2003, "Noninteger " "exponent in an initialization " "expression at %L", &op2->where) == FAILURE) return ARITH_PROHIBIT; diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 51528b410f6..b8523624faf 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -555,7 +555,7 @@ gfc_match_array_spec (gfc_array_spec **asp, bool match_dim, bool match_codim) } if (as->corank + as->rank >= 7 - && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Array " + && gfc_notify_std (GFC_STD_F2008, "Array " "specification at %C with more than 7 dimensions") == FAILURE) goto cleanup; @@ -568,7 +568,7 @@ coarray: if (gfc_match_char ('[') != MATCH_YES) goto done; - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Coarray declaration at %C") + if (gfc_notify_std (GFC_STD_F2008, "Coarray declaration at %C") == FAILURE) goto cleanup; @@ -1027,7 +1027,7 @@ gfc_match_array_constructor (gfc_expr **result) return MATCH_NO; else { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: [...] " + if (gfc_notify_std (GFC_STD_F2003, "[...] " "style array constructors at %C") == FAILURE) return MATCH_ERROR; end_delim = " ]"; @@ -1047,7 +1047,7 @@ gfc_match_array_constructor (gfc_expr **result) if (seen_ts) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Array constructor " + if (gfc_notify_std (GFC_STD_F2003, "Array constructor " "including type specification at %C") == FAILURE) goto cleanup; diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index 407052f655d..bfd12057632 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -862,7 +862,7 @@ gfc_check_a_p (gfc_expr *a, gfc_expr *p) if (a->ts.kind != p->ts.kind) { - if (gfc_notify_std (GFC_STD_GNU, "Extension: Different type kinds at %L", + if (gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L", &p->where) == FAILURE) return FAILURE; } @@ -1081,7 +1081,7 @@ gfc_check_besn (gfc_expr *n, gfc_expr *x) { int i; gfc_extract_int (n, &i); - if (i < 0 && gfc_notify_std (GFC_STD_GNU, "Extension: Negative argument " + if (i < 0 && gfc_notify_std (GFC_STD_GNU, "Negative argument " "N at %L", &n->where) == FAILURE) return FAILURE; } @@ -1306,7 +1306,7 @@ gfc_check_count (gfc_expr *mask, gfc_expr *dim, gfc_expr *kind) return FAILURE; if (kind_check (kind, 2, BT_INTEGER) == FAILURE) return FAILURE; - if (kind && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: '%s' intrinsic " + if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic " "with KIND argument at %L", gfc_current_intrinsic, &kind->where) == FAILURE) return FAILURE; @@ -1664,7 +1664,7 @@ gfc_check_float (gfc_expr *a) return FAILURE; if ((a->ts.kind != gfc_default_integer_kind) - && gfc_notify_std (GFC_STD_GNU, "GNU extension: non-default INTEGER " + && gfc_notify_std (GFC_STD_GNU, "non-default INTEGER " "kind argument to %s intrinsic at %L", gfc_current_intrinsic, &a->where) == FAILURE ) return FAILURE; @@ -1724,7 +1724,7 @@ gfc_check_fn_rc2008 (gfc_expr *a) return FAILURE; if (a->ts.type == BT_COMPLEX - && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: COMPLEX argument '%s' " + && gfc_notify_std (GFC_STD_F2008, "COMPLEX argument '%s' " "argument of '%s' intrinsic at %L", gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic, &a->where) == FAILURE) @@ -1792,7 +1792,7 @@ gfc_check_iand (gfc_expr *i, gfc_expr *j) if (i->ts.kind != j->ts.kind) { - if (gfc_notify_std (GFC_STD_GNU, "Extension: Different type kinds at %L", + if (gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L", &i->where) == FAILURE) return FAILURE; } @@ -1837,7 +1837,7 @@ gfc_check_ichar_iachar (gfc_expr *c, gfc_expr *kind) if (kind_check (kind, 1, BT_INTEGER) == FAILURE) return FAILURE; - if (kind && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: '%s' intrinsic " + if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic " "with KIND argument at %L", gfc_current_intrinsic, &kind->where) == FAILURE) return FAILURE; @@ -1918,7 +1918,7 @@ gfc_check_ieor (gfc_expr *i, gfc_expr *j) if (i->ts.kind != j->ts.kind) { - if (gfc_notify_std (GFC_STD_GNU, "Extension: Different type kinds at %L", + if (gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L", &i->where) == FAILURE) return FAILURE; } @@ -1940,7 +1940,7 @@ gfc_check_index (gfc_expr *string, gfc_expr *substring, gfc_expr *back, if (kind_check (kind, 3, BT_INTEGER) == FAILURE) return FAILURE; - if (kind && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: '%s' intrinsic " + if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic " "with KIND argument at %L", gfc_current_intrinsic, &kind->where) == FAILURE) return FAILURE; @@ -1992,7 +1992,7 @@ gfc_check_ior (gfc_expr *i, gfc_expr *j) if (i->ts.kind != j->ts.kind) { - if (gfc_notify_std (GFC_STD_GNU, "Extension: Different type kinds at %L", + if (gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L", &i->where) == FAILURE) return FAILURE; } @@ -2134,7 +2134,7 @@ gfc_check_lbound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) if (kind_check (kind, 2, BT_INTEGER) == FAILURE) return FAILURE; - if (kind && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: '%s' intrinsic " + if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic " "with KIND argument at %L", gfc_current_intrinsic, &kind->where) == FAILURE) return FAILURE; @@ -2179,7 +2179,7 @@ gfc_check_len_lentrim (gfc_expr *s, gfc_expr *kind) if (kind_check (kind, 1, BT_INTEGER) == FAILURE) return FAILURE; - if (kind && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: '%s' intrinsic " + if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic " "with KIND argument at %L", gfc_current_intrinsic, &kind->where) == FAILURE) return FAILURE; @@ -2344,7 +2344,7 @@ check_rest (bt type, int kind, gfc_actual_arglist *arglist) { if (x->ts.type == type) { - if (gfc_notify_std (GFC_STD_GNU, "Extension: Different type " + if (gfc_notify_std (GFC_STD_GNU, "Different type " "kinds at %L", &x->where) == FAILURE) return FAILURE; } @@ -2381,7 +2381,7 @@ gfc_check_min_max (gfc_actual_arglist *arg) if (x->ts.type == BT_CHARACTER) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: '%s' intrinsic " + if (gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic " "with CHARACTER argument at %L", gfc_current_intrinsic, &x->where) == FAILURE) return FAILURE; @@ -2863,7 +2863,7 @@ gfc_check_null (gfc_expr *mold) } if (attr.allocatable - && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: NULL intrinsic with " + && gfc_notify_std (GFC_STD_F2003, "NULL intrinsic with " "allocatable MOLD at %L", &mold->where) == FAILURE) return FAILURE; @@ -3399,7 +3399,7 @@ gfc_check_scan (gfc_expr *x, gfc_expr *y, gfc_expr *z, gfc_expr *kind) if (kind_check (kind, 3, BT_INTEGER) == FAILURE) return FAILURE; - if (kind && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: '%s' intrinsic " + if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic " "with KIND argument at %L", gfc_current_intrinsic, &kind->where) == FAILURE) return FAILURE; @@ -3460,7 +3460,7 @@ gfc_try gfc_check_selected_real_kind (gfc_expr *p, gfc_expr *r, gfc_expr *radix) { if (p == NULL && r == NULL - && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: SELECTED_REAL_KIND with" + && gfc_notify_std (GFC_STD_F2008, "SELECTED_REAL_KIND with" " neither 'P' nor 'R' argument at %L", gfc_current_intrinsic_where) == FAILURE) return FAILURE; @@ -3491,7 +3491,7 @@ gfc_check_selected_real_kind (gfc_expr *p, gfc_expr *r, gfc_expr *radix) if (scalar_check (radix, 1) == FAILURE) return FAILURE; - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: '%s' intrinsic with " + if (gfc_notify_std (GFC_STD_F2008, "'%s' intrinsic with " "RADIX argument at %L", gfc_current_intrinsic, &radix->where) == FAILURE) return FAILURE; @@ -3533,7 +3533,7 @@ gfc_check_shape (gfc_expr *source, gfc_expr *kind) if (kind_check (kind, 1, BT_INTEGER) == FAILURE) return FAILURE; - if (kind && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: '%s' intrinsic " + if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic " "with KIND argument at %L", gfc_current_intrinsic, &kind->where) == FAILURE) return FAILURE; @@ -3588,7 +3588,7 @@ gfc_check_size (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) if (kind_check (kind, 2, BT_INTEGER) == FAILURE) return FAILURE; - if (kind && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: '%s' intrinsic " + if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic " "with KIND argument at %L", gfc_current_intrinsic, &kind->where) == FAILURE) return FAILURE; @@ -3646,7 +3646,7 @@ gfc_check_sngl (gfc_expr *a) return FAILURE; if ((a->ts.kind != gfc_default_double_kind) - && gfc_notify_std (GFC_STD_GNU, "GNU extension: non double precision " + && gfc_notify_std (GFC_STD_GNU, "non double precision " "REAL argument to %s intrinsic at %L", gfc_current_intrinsic, &a->where) == FAILURE) return FAILURE; @@ -4127,7 +4127,7 @@ gfc_check_ubound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) if (kind_check (kind, 2, BT_INTEGER) == FAILURE) return FAILURE; - if (kind && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: '%s' intrinsic " + if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic " "with KIND argument at %L", gfc_current_intrinsic, &kind->where) == FAILURE) return FAILURE; @@ -4256,7 +4256,7 @@ gfc_check_verify (gfc_expr *x, gfc_expr *y, gfc_expr *z, gfc_expr *kind) if (kind_check (kind, 3, BT_INTEGER) == FAILURE) return FAILURE; - if (kind && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: '%s' intrinsic " + if (kind && gfc_notify_std (GFC_STD_F2003, "'%s' intrinsic " "with KIND argument at %L", gfc_current_intrinsic, &kind->where) == FAILURE) return FAILURE; diff --git a/gcc/fortran/data.c b/gcc/fortran/data.c index a55b67e074f..385ca898dcd 100644 --- a/gcc/fortran/data.c +++ b/gcc/fortran/data.c @@ -315,7 +315,7 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index, exprd = (LOCATION_LINE (con->expr->where.lb->location) > LOCATION_LINE (rvalue->where.lb->location)) ? con->expr : rvalue; - if (gfc_notify_std (GFC_STD_GNU,"Extension: " + if (gfc_notify_std (GFC_STD_GNU, "re-initialization of '%s' at %L", symbol->name, &exprd->where) == FAILURE) return FAILURE; @@ -481,7 +481,7 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index, expr = (LOCATION_LINE (init->where.lb->location) > LOCATION_LINE (rvalue->where.lb->location)) ? init : rvalue; - if (gfc_notify_std (GFC_STD_GNU,"Extension: " + if (gfc_notify_std (GFC_STD_GNU, "re-initialization of '%s' at %L", symbol->name, &expr->where) == FAILURE) return FAILURE; diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 83a4c602f1d..01693ad4cb0 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -269,7 +269,7 @@ var_element (gfc_data_variable *new_var) if (gfc_current_state () != COMP_BLOCK_DATA && sym->attr.in_common - && gfc_notify_std (GFC_STD_GNU, "Extension: initialization of " + && gfc_notify_std (GFC_STD_GNU, "initialization of " "common block variable '%s' in DATA statement at %C", sym->name) == FAILURE) return MATCH_ERROR; @@ -677,7 +677,7 @@ char_len_param_value (gfc_expr **expr, bool *deferred) if (gfc_match_char (':') == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: deferred type " + if (gfc_notify_std (GFC_STD_F2003, "deferred type " "parameter at %C") == FAILURE) return MATCH_ERROR; @@ -740,7 +740,7 @@ match_char_length (gfc_expr **expr, bool *deferred, bool obsolenscent_check) if (m == MATCH_YES) { if (obsolenscent_check - && gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: " + && gfc_notify_std (GFC_STD_F95_OBS, "Old-style character length at %C") == FAILURE) return MATCH_ERROR; *expr = gfc_get_int_expr (gfc_default_integer_kind, NULL, length); @@ -1083,7 +1083,7 @@ gfc_verify_c_interop_param (gfc_symbol *sym) retval = FAILURE; } else if (sym->attr.optional == 1 - && gfc_notify_std (GFC_STD_F2008_TS, "TS29113: Variable '%s' " + && gfc_notify_std (GFC_STD_F2008_TS, "Variable '%s' " "at %L with OPTIONAL attribute in " "procedure '%s' which is BIND(C)", sym->name, &(sym->declared_at), @@ -1739,7 +1739,7 @@ match_pointer_init (gfc_expr **init, int procptr) if (!procptr) gfc_resolve_expr (*init); - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: non-NULL pointer " + if (gfc_notify_std (GFC_STD_F2008, "non-NULL pointer " "initialization at %C") == FAILURE) return MATCH_ERROR; @@ -1836,7 +1836,7 @@ variable_decl (int elem) if (as->type == AS_IMPLIED_SHAPE && gfc_notify_std (GFC_STD_F2008, - "Fortran 2008: Implied-shape array at %L", + "Implied-shape array at %L", &var_locus) == FAILURE) { m = MATCH_ERROR; @@ -1995,7 +1995,7 @@ variable_decl (int elem) if (!colon_seen && gfc_match (" /") == MATCH_YES) { - if (gfc_notify_std (GFC_STD_GNU, "Extension: Old-style " + if (gfc_notify_std (GFC_STD_GNU, "Old-style " "initialization at %C") == FAILURE) return MATCH_ERROR; @@ -2588,7 +2588,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) if (gfc_match (" byte") == MATCH_YES) { - if (gfc_notify_std (GFC_STD_GNU, "Extension: BYTE type at %C") + if (gfc_notify_std (GFC_STD_GNU, "BYTE type at %C") == FAILURE) return MATCH_ERROR; @@ -2619,7 +2619,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) gfc_error ("Assumed type at %C is not allowed for components"); return MATCH_ERROR; } - if (gfc_notify_std (GFC_STD_F2008_TS, "TS 29113: Assumed type " + if (gfc_notify_std (GFC_STD_F2008_TS, "Assumed type " "at %C") == FAILURE) return MATCH_ERROR; ts->type = BT_ASSUMED; @@ -2642,7 +2642,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) || (!matched_type && gfc_match (" character") == MATCH_YES)) { if (matched_type - && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: TYPE with " + && gfc_notify_std (GFC_STD_F2008, "TYPE with " "intrinsic-type-spec at %C") == FAILURE) return MATCH_ERROR; @@ -2673,7 +2673,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) || (!matched_type && gfc_match (" double precision") == MATCH_YES)) { if (matched_type - && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: TYPE with " + && gfc_notify_std (GFC_STD_F2008, "TYPE with " "intrinsic-type-spec at %C") == FAILURE) return MATCH_ERROR; if (matched_type && gfc_match_char (')') != MATCH_YES) @@ -2698,12 +2698,12 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) && gfc_match (" complex") == MATCH_YES))) || (!matched_type && gfc_match (" double complex") == MATCH_YES)) { - if (gfc_notify_std (GFC_STD_GNU, "Extension: DOUBLE COMPLEX at %C") + if (gfc_notify_std (GFC_STD_GNU, "DOUBLE COMPLEX at %C") == FAILURE) return MATCH_ERROR; if (matched_type - && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: TYPE with " + && gfc_notify_std (GFC_STD_F2008, "TYPE with " "intrinsic-type-spec at %C") == FAILURE) return MATCH_ERROR; @@ -2745,7 +2745,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) return m; ts->type = BT_CLASS; - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: CLASS statement at %C") + if (gfc_notify_std (GFC_STD_F2003, "CLASS statement at %C") == FAILURE) return MATCH_ERROR; } @@ -2853,7 +2853,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) get_kind: if (matched_type - && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: TYPE with " + && gfc_notify_std (GFC_STD_F2008, "TYPE with " "intrinsic-type-spec at %C") == FAILURE) return MATCH_ERROR; @@ -3138,7 +3138,7 @@ gfc_match_import (void) return MATCH_ERROR; } - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: IMPORT statement at %C") + if (gfc_notify_std (GFC_STD_F2003, "IMPORT statement at %C") == FAILURE) return MATCH_ERROR; @@ -3634,7 +3634,7 @@ match_attr_spec (void) { if (d == DECL_ALLOCATABLE) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ALLOCATABLE " + if (gfc_notify_std (GFC_STD_F2003, "ALLOCATABLE " "attribute at %C in a TYPE definition") == FAILURE) { @@ -3662,7 +3662,7 @@ match_attr_spec (void) && gfc_state_stack->previous && gfc_state_stack->previous->state == COMP_MODULE) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Attribute %s " + if (gfc_notify_std (GFC_STD_F2003, "Attribute %s " "at %L in a TYPE definition", attr, &seen_at[d]) == FAILURE) @@ -3688,7 +3688,7 @@ match_attr_spec (void) case DECL_ASYNCHRONOUS: if (gfc_notify_std (GFC_STD_F2003, - "Fortran 2003: ASYNCHRONOUS attribute at %C") + "ASYNCHRONOUS attribute at %C") == FAILURE) t = FAILURE; else @@ -3701,7 +3701,7 @@ match_attr_spec (void) case DECL_CONTIGUOUS: if (gfc_notify_std (GFC_STD_F2008, - "Fortran 2008: CONTIGUOUS attribute at %C") + "CONTIGUOUS attribute at %C") == FAILURE) t = FAILURE; else @@ -3753,7 +3753,7 @@ match_attr_spec (void) break; } - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: PROTECTED " + if (gfc_notify_std (GFC_STD_F2003, "PROTECTED " "attribute at %C") == FAILURE) t = FAILURE; @@ -3784,7 +3784,7 @@ match_attr_spec (void) break; case DECL_VALUE: - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: VALUE attribute " + if (gfc_notify_std (GFC_STD_F2003, "VALUE attribute " "at %C") == FAILURE) t = FAILURE; @@ -3794,7 +3794,7 @@ match_attr_spec (void) case DECL_VOLATILE: if (gfc_notify_std (GFC_STD_F2003, - "Fortran 2003: VOLATILE attribute at %C") + "VOLATILE attribute at %C") == FAILURE) t = FAILURE; else @@ -4374,7 +4374,7 @@ gfc_match_prefix (gfc_typespec *ts) if (gfc_match ("impure% ") == MATCH_YES) { if (gfc_notify_std (GFC_STD_F2008, - "Fortran 2008: IMPURE procedure at %C") + "IMPURE procedure at %C") == FAILURE) goto error; @@ -4660,7 +4660,7 @@ gfc_match_suffix (gfc_symbol *sym, gfc_symbol **result) /* Fortran 2008 draft allows BIND(C) for internal procedures. */ if (gfc_current_state () == COMP_CONTAINS && sym->ns->proc_name->attr.flavor != FL_MODULE - && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: BIND(C) attribute " + && gfc_notify_std (GFC_STD_F2008, "BIND(C) attribute " "at %L may not be specified for an internal " "procedure", &gfc_current_locus) == FAILURE) @@ -5031,7 +5031,7 @@ match_ppc_decl (void) return MATCH_ERROR; } - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Procedure pointer " + if (gfc_notify_std (GFC_STD_F2003, "Procedure pointer " "component at %C") == FAILURE) return MATCH_ERROR; @@ -5123,7 +5123,7 @@ match_procedure_in_interface (void) old_locus = gfc_current_locus; if (gfc_match ("::") == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: double colon in " + if (gfc_notify_std (GFC_STD_F2008, "double colon in " "MODULE PROCEDURE statement at %L", &old_locus) == FAILURE) return MATCH_ERROR; @@ -5193,7 +5193,7 @@ gfc_match_procedure (void) if (m != MATCH_YES) return m; - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: PROCEDURE statement at %C") + if (gfc_notify_std (GFC_STD_F2003, "PROCEDURE statement at %C") == FAILURE) return MATCH_ERROR; @@ -5404,7 +5404,7 @@ gfc_match_entry (void) if (m != MATCH_YES) return m; - if (gfc_notify_std (GFC_STD_F2008_OBS, "Fortran 2008 obsolescent feature: " + if (gfc_notify_std (GFC_STD_F2008_OBS, "ENTRY statement at %C") == FAILURE) return MATCH_ERROR; @@ -5715,7 +5715,7 @@ gfc_match_subroutine (void) /* The following is allowed in the Fortran 2008 draft. */ if (gfc_current_state () == COMP_CONTAINS && sym->ns->proc_name->attr.flavor != FL_MODULE - && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: BIND(C) attribute " + && gfc_notify_std (GFC_STD_F2008, "BIND(C) attribute " "at %L may not be specified for an internal " "procedure", &gfc_current_locus) == FAILURE) @@ -6085,7 +6085,7 @@ gfc_match_end (gfc_statement *st) { if (!eos_ok && (*st == ST_END_SUBROUTINE || *st == ST_END_FUNCTION)) { - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: END statement " + if (gfc_notify_std (GFC_STD_F2008, "END statement " "instead of %s statement at %L", gfc_ascii_statement (*st), &old_loc) == FAILURE) goto cleanup; @@ -6611,7 +6611,7 @@ gfc_match_codimension (void) match gfc_match_contiguous (void) { - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: CONTIGUOUS statement at %C") + if (gfc_notify_std (GFC_STD_F2008, "CONTIGUOUS statement at %C") == FAILURE) return MATCH_ERROR; @@ -6764,7 +6764,7 @@ gfc_match_protected (void) } - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: PROTECTED statement at %C") + if (gfc_notify_std (GFC_STD_F2003, "PROTECTED statement at %C") == FAILURE) return MATCH_ERROR; @@ -7062,7 +7062,7 @@ gfc_match_value (void) return MATCH_ERROR; } - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: VALUE statement at %C") + if (gfc_notify_std (GFC_STD_F2003, "VALUE statement at %C") == FAILURE) return MATCH_ERROR; @@ -7113,7 +7113,7 @@ gfc_match_volatile (void) gfc_symbol *sym; match m; - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: VOLATILE statement at %C") + if (gfc_notify_std (GFC_STD_F2003, "VOLATILE statement at %C") == FAILURE) return MATCH_ERROR; @@ -7174,7 +7174,7 @@ gfc_match_asynchronous (void) gfc_symbol *sym; match m; - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ASYNCHRONOUS statement at %C") + if (gfc_notify_std (GFC_STD_F2003, "ASYNCHRONOUS statement at %C") == FAILURE) return MATCH_ERROR; @@ -7265,7 +7265,7 @@ gfc_match_modproc (void) old_locus = gfc_current_locus; if (gfc_match ("::") == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: double colon in " + if (gfc_notify_std (GFC_STD_F2008, "double colon in " "MODULE PROCEDURE statement at %L", &old_locus) == FAILURE) return MATCH_ERROR; @@ -7432,7 +7432,7 @@ gfc_get_type_attr_spec (symbol_attribute *attr, char *name) } else if (gfc_match (" , abstract") == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ABSTRACT type at %C") + if (gfc_notify_std (GFC_STD_F2003, "ABSTRACT type at %C") == FAILURE) return MATCH_ERROR; @@ -7663,7 +7663,7 @@ gfc_match_enum (void) if (m != MATCH_YES) return m; - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ENUM and ENUMERATOR at %C") + if (gfc_notify_std (GFC_STD_F2003, "ENUM and ENUMERATOR at %C") == FAILURE) return MATCH_ERROR; @@ -8157,7 +8157,7 @@ match_procedure_in_type (void) return MATCH_ERROR; } - if (num>1 && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: PROCEDURE list" + if (num>1 && gfc_notify_std (GFC_STD_F2008, "PROCEDURE list" " at %C") == FAILURE) return MATCH_ERROR; diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c index 25d3cba9750..7e968dbb996 100644 --- a/gcc/fortran/error.c +++ b/gcc/fortran/error.c @@ -809,6 +809,8 @@ gfc_notify_std (int std, const char *gmsgid, ...) { va_list argp; bool warning; + const char *msg1, *msg2; + char *buffer; warning = ((gfc_option.warn_std & std) != 0) && !inhibit_warnings; if ((gfc_option.allow_std & std) != 0 && !warning) @@ -821,11 +823,48 @@ gfc_notify_std (int std, const char *gmsgid, ...) cur_error_buffer->flag = 1; cur_error_buffer->index = 0; - va_start (argp, gmsgid); if (warning) - error_print (_("Warning:"), _(gmsgid), argp); + msg1 = _("Warning:"); else - error_print (_("Error:"), _(gmsgid), argp); + msg1 = _("Error:"); + + switch (std) + { + case GFC_STD_F2008_TS: + msg2 = "TS 29113:"; + break; + case GFC_STD_F2008_OBS: + msg2 = _("Fortran 2008 obsolescent feature:"); + break; + case GFC_STD_F2008: + msg2 = "Fortran 2008:"; + break; + case GFC_STD_F2003: + msg2 = "Fortran 2003:"; + break; + case GFC_STD_GNU: + msg2 = _("GNU Extension:"); + break; + case GFC_STD_LEGACY: + msg2 = _("Legacy Extension:"); + break; + case GFC_STD_F95_OBS: + msg2 = _("Obsolescent feature:"); + break; + case GFC_STD_F95_DEL: + msg2 = _("Deleted feature:"); + break; + default: + gcc_unreachable (); + } + + buffer = (char *) alloca (strlen (msg1) + strlen (msg2) + 2); + strcpy (buffer, msg1); + strcat (buffer, " "); + strcat (buffer, msg2); + + va_start (argp, gmsgid); + error_print (buffer, _(gmsgid), argp); va_end (argp); error_char ('\0'); diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index a107369f23e..88a59bc89db 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -2405,7 +2405,7 @@ check_elemental (gfc_expr *e) if (e->ts.type != BT_INTEGER && e->ts.type != BT_CHARACTER - && gfc_notify_std (GFC_STD_F2003, "Extension: Evaluation of " + && gfc_notify_std (GFC_STD_F2003, "Evaluation of " "nonstandard initialization expression at %L", &e->where) == FAILURE) return MATCH_ERROR; @@ -3164,13 +3164,13 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform) if (rvalue->is_boz && lvalue->ts.type != BT_INTEGER && lvalue->symtree->n.sym->attr.data - && gfc_notify_std (GFC_STD_GNU, "Extension: BOZ literal at %L used to " + && gfc_notify_std (GFC_STD_GNU, "BOZ literal at %L used to " "initialize non-integer variable '%s'", &rvalue->where, lvalue->symtree->n.sym->name) == FAILURE) return FAILURE; else if (rvalue->is_boz && !lvalue->symtree->n.sym->attr.data - && gfc_notify_std (GFC_STD_GNU, "Extension: BOZ literal at %L outside " + && gfc_notify_std (GFC_STD_GNU, "BOZ literal at %L outside " "a DATA statement and outside INT/REAL/DBLE/CMPLX", &rvalue->where) == FAILURE) return FAILURE; @@ -3338,7 +3338,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue) return FAILURE; } - if (gfc_notify_std (GFC_STD_F2003,"Fortran 2003: Bounds " + if (gfc_notify_std (GFC_STD_F2003,"Bounds " "specification for '%s' in pointer assignment " "at %L", lvalue->symtree->n.sym->name, &lvalue->where) == FAILURE) @@ -3439,9 +3439,10 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue) return FAILURE; } if (attr.proc == PROC_INTERNAL && - gfc_notify_std (GFC_STD_F2008, "Internal procedure '%s' is " - "invalid in procedure pointer assignment at %L", - rvalue->symtree->name, &rvalue->where) == FAILURE) + gfc_notify_std (GFC_STD_F2008, "Internal procedure " + "'%s' is invalid in procedure pointer assignment " + "at %L", rvalue->symtree->name, &rvalue->where) + == FAILURE) return FAILURE; } /* Check for F08:C730. */ @@ -3562,7 +3563,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue) " simply contiguous at %L", &rvalue->where); return FAILURE; } - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Rank remapping" + if (gfc_notify_std (GFC_STD_F2008, "Rank remapping" " target is not rank 1 at %L", &rvalue->where) == FAILURE) return FAILURE; diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 6f40ba76e68..922de039c2d 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -253,7 +253,7 @@ gfc_match_abstract_interface (void) { match m; - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ABSTRACT INTERFACE at %C") + if (gfc_notify_std (GFC_STD_F2003, "ABSTRACT INTERFACE at %C") == FAILURE) return MATCH_ERROR; @@ -1313,7 +1313,7 @@ check_interface0 (gfc_interface *p, const char *interface_name) /* F2003, C1207. F2008, C1207. */ if (p->sym->attr.proc == PROC_INTERNAL - && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Internal procedure " + && gfc_notify_std (GFC_STD_F2008, "Internal procedure " "'%s' in %s at %L", p->sym->name, interface_name, &p->sym->declared_at) == FAILURE) return 1; diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index a7ab56ee74f..dbfadb42b11 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -4083,7 +4083,7 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag) if ((isym->id == GFC_ISYM_REAL || isym->id == GFC_ISYM_DBLE || isym->id == GFC_ISYM_CMPLX) && gfc_init_expr_flag - && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Function '%s' " + && gfc_notify_std (GFC_STD_F2003, "Function '%s' " "as initialization expression at %L", name, &expr->where) == FAILURE) { @@ -4159,7 +4159,7 @@ got_specific: where each argument is an initialization expression */ if (gfc_init_expr_flag && isym->elemental && flag - && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Elemental function " + && gfc_notify_std (GFC_STD_F2003, "Elemental function " "as initialization expression with non-integer/non-" "character arguments at %L", &expr->where) == FAILURE) return MATCH_ERROR; diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 3bc427d6159..428799c1262 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -451,14 +451,14 @@ format_lex (void) c = next_char_not_space (&error); if (c == 'P') { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: DP format " + if (gfc_notify_std (GFC_STD_F2003, "DP format " "specifier not allowed at %C") == FAILURE) return FMT_ERROR; token = FMT_DP; } else if (c == 'C') { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: DC format " + if (gfc_notify_std (GFC_STD_F2003, "DC format " "specifier not allowed at %C") == FAILURE) return FMT_ERROR; token = FMT_DC; @@ -647,7 +647,7 @@ format_item_1: /* X requires a prior number if we're being pedantic. */ if (mode != MODE_FORMAT) format_locus.nextc += format_string_pos; - if (gfc_notify_std (GFC_STD_GNU, "Extension: X descriptor " + if (gfc_notify_std (GFC_STD_GNU, "X descriptor " "requires leading space count at %L", &format_locus) == FAILURE) return FAILURE; @@ -677,7 +677,7 @@ format_item_1: if (t == FMT_ERROR) goto fail; - if (gfc_notify_std (GFC_STD_GNU, "Extension: $ descriptor at %L", + if (gfc_notify_std (GFC_STD_GNU, "$ descriptor at %L", &format_locus) == FAILURE) return FAILURE; if (t != FMT_RPAREN || level > 0) @@ -824,7 +824,7 @@ data_desc: error = zero_width; goto syntax; } - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: 'G0' in " + if (gfc_notify_std (GFC_STD_F2008, "'G0' in " "format at %L", &format_locus) == FAILURE) return FAILURE; u = format_lex (); @@ -1057,7 +1057,7 @@ between_desc: default: if (mode != MODE_FORMAT) format_locus.nextc += format_string_pos - 1; - if (gfc_notify_std (GFC_STD_GNU, "Extension: Missing comma at %L", + if (gfc_notify_std (GFC_STD_GNU, "Missing comma at %L", &format_locus) == FAILURE) return FAILURE; /* If we do not actually return a failure, we need to unwind this @@ -1120,7 +1120,7 @@ extension_optional_comma: default: if (mode != MODE_FORMAT) format_locus.nextc += format_string_pos; - if (gfc_notify_std (GFC_STD_GNU, "Extension: Missing comma at %L", + if (gfc_notify_std (GFC_STD_GNU, "Missing comma at %L", &format_locus) == FAILURE) return FAILURE; /* If we do not actually return a failure, we need to unwind this @@ -1405,7 +1405,7 @@ resolve_tag_format (const gfc_expr *e) } else if (e->ts.type == BT_INTEGER && e->expr_type == EXPR_VARIABLE) { - if (gfc_notify_std (GFC_STD_F95_DEL, "Deleted feature: ASSIGNED " + if (gfc_notify_std (GFC_STD_F95_DEL, "ASSIGNED " "variable in FORMAT tag at %L", &e->where) == FAILURE) return FAILURE; @@ -1430,7 +1430,7 @@ resolve_tag_format (const gfc_expr *e) It may be assigned an Hollerith constant. */ if (e->ts.type != BT_CHARACTER) { - if (gfc_notify_std (GFC_STD_LEGACY, "Extension: Non-character " + if (gfc_notify_std (GFC_STD_LEGACY, "Non-character " "in FORMAT tag at %L", &e->where) == FAILURE) return FAILURE; @@ -1496,7 +1496,7 @@ resolve_tag (const io_tag *tag, gfc_expr *e) if (tag == &tag_iomsg) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: IOMSG tag at %L", + if (gfc_notify_std (GFC_STD_F2003, "IOMSG tag at %L", &e->where) == FAILURE) return FAILURE; } @@ -1512,7 +1512,7 @@ resolve_tag (const io_tag *tag, gfc_expr *e) if (tag == &tag_exist && e->ts.kind != gfc_default_logical_kind) { - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Nondefault LOGICAL " + if (gfc_notify_std (GFC_STD_F2008, "Nondefault LOGICAL " "in %s tag at %L", tag->name, &e->where) == FAILURE) return FAILURE; @@ -1520,7 +1520,7 @@ resolve_tag (const io_tag *tag, gfc_expr *e) if (tag == &tag_newunit) { - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: NEWUNIT specifier" + if (gfc_notify_std (GFC_STD_F2008, "NEWUNIT specifier" " at %L", &e->where) == FAILURE) return FAILURE; } @@ -1538,7 +1538,7 @@ resolve_tag (const io_tag *tag, gfc_expr *e) if (tag == &tag_convert) { - if (gfc_notify_std (GFC_STD_GNU, "Extension: CONVERT tag at %L", + if (gfc_notify_std (GFC_STD_GNU, "CONVERT tag at %L", &e->where) == FAILURE) return FAILURE; } @@ -1732,7 +1732,7 @@ compare_to_allowed_values (const char *specifier, const char *allowed[], else if (n == ERROR) { - gfc_notify_std (GFC_STD_F2003, "Fortran 2003: %s specifier in " + gfc_notify_std (GFC_STD_F2003, "%s specifier in " "%s statement at %C has value '%s'", specifier, statement, allowed_f2003[i]); return 0; @@ -1759,7 +1759,7 @@ compare_to_allowed_values (const char *specifier, const char *allowed[], else if (n == ERROR) { - gfc_notify_std (GFC_STD_GNU, "Extension: %s specifier in " + gfc_notify_std (GFC_STD_GNU, "%s specifier in " "%s statement at %C has value '%s'", specifier, statement, allowed_gnu[i]); return 0; @@ -1894,7 +1894,7 @@ gfc_match_open (void) /* Checks on the ASYNCHRONOUS specifier. */ if (open->asynchronous) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ASYNCHRONOUS= at %C " + if (gfc_notify_std (GFC_STD_F2003, "ASYNCHRONOUS= at %C " "not allowed in Fortran 95") == FAILURE) goto cleanup; @@ -1912,7 +1912,7 @@ gfc_match_open (void) /* Checks on the BLANK specifier. */ if (open->blank) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: BLANK= at %C " + if (gfc_notify_std (GFC_STD_F2003, "BLANK= at %C " "not allowed in Fortran 95") == FAILURE) goto cleanup; @@ -1930,7 +1930,7 @@ gfc_match_open (void) /* Checks on the DECIMAL specifier. */ if (open->decimal) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: DECIMAL= at %C " + if (gfc_notify_std (GFC_STD_F2003, "DECIMAL= at %C " "not allowed in Fortran 95") == FAILURE) goto cleanup; @@ -1962,7 +1962,7 @@ gfc_match_open (void) /* Checks on the ENCODING specifier. */ if (open->encoding) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ENCODING= at %C " + if (gfc_notify_std (GFC_STD_F2003, "ENCODING= at %C " "not allowed in Fortran 95") == FAILURE) goto cleanup; @@ -2013,7 +2013,7 @@ gfc_match_open (void) /* Checks on the ROUND specifier. */ if (open->round) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ROUND= at %C " + if (gfc_notify_std (GFC_STD_F2003, "ROUND= at %C " "not allowed in Fortran 95") == FAILURE) goto cleanup; @@ -2033,7 +2033,7 @@ gfc_match_open (void) /* Checks on the SIGN specifier. */ if (open->sign) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: SIGN= at %C " + if (gfc_notify_std (GFC_STD_F2003, "SIGN= at %C " "not allowed in Fortran 95") == FAILURE) goto cleanup; @@ -2479,7 +2479,7 @@ gfc_match_rewind (void) match gfc_match_flush (void) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: FLUSH statement at %C") + if (gfc_notify_std (GFC_STD_F2003, "FLUSH statement at %C") == FAILURE) return MATCH_ERROR; @@ -2910,7 +2910,7 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc) } if (dt->extra_comma - && gfc_notify_std (GFC_STD_GNU, "Extension: Comma before i/o " + && gfc_notify_std (GFC_STD_GNU, "Comma before i/o " "item list at %L", &dt->extra_comma->where) == FAILURE) return FAILURE; @@ -3256,7 +3256,7 @@ if (condition) \ if (dt->namelist != NULL) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Internal file " + if (gfc_notify_std (GFC_STD_F2003, "Internal file " "at %L with namelist", &expr->where) == FAILURE) m = MATCH_ERROR; @@ -3340,7 +3340,7 @@ if (condition) \ if (dt->decimal) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: DECIMAL= at %C " + if (gfc_notify_std (GFC_STD_F2003, "DECIMAL= at %C " "not allowed in Fortran 95") == FAILURE) return MATCH_ERROR; @@ -3361,7 +3361,7 @@ if (condition) \ if (dt->blank) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: BLANK= at %C " + if (gfc_notify_std (GFC_STD_F2003, "BLANK= at %C " "not allowed in Fortran 95") == FAILURE) return MATCH_ERROR; @@ -3382,7 +3382,7 @@ if (condition) \ if (dt->pad) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: PAD= at %C " + if (gfc_notify_std (GFC_STD_F2003, "PAD= at %C " "not allowed in Fortran 95") == FAILURE) return MATCH_ERROR; @@ -3403,7 +3403,7 @@ if (condition) \ if (dt->round) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ROUND= at %C " + if (gfc_notify_std (GFC_STD_F2003, "ROUND= at %C " "not allowed in Fortran 95") == FAILURE) return MATCH_ERROR; @@ -3423,7 +3423,7 @@ if (condition) \ if (dt->sign) { /* When implemented, change the following to use gfc_notify_std F2003. - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: SIGN= at %C " + if (gfc_notify_std (GFC_STD_F2003, "SIGN= at %C " "not allowed in Fortran 95") == FAILURE) return MATCH_ERROR; */ if (dt->sign->expr_type == EXPR_CONSTANT) @@ -3448,7 +3448,7 @@ if (condition) \ if (dt->delim) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: DELIM= at %C " + if (gfc_notify_std (GFC_STD_F2003, "DELIM= at %C " "not allowed in Fortran 95") == FAILURE) return MATCH_ERROR; @@ -4197,7 +4197,7 @@ gfc_match_wait (void) goto syntax; } - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: WAIT at %C " + if (gfc_notify_std (GFC_STD_F2003, "WAIT at %C " "not allowed in Fortran 95") == FAILURE) goto cleanup; diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index f86916a9c22..737d6a31676 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -1393,7 +1393,7 @@ match_arithmetic_if (void) return MATCH_ERROR; } - if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: Arithmetic IF " + if (gfc_notify_std (GFC_STD_F95_OBS, "Arithmetic IF " "statement at %C") == FAILURE) return MATCH_ERROR; @@ -1474,7 +1474,7 @@ gfc_match_if (gfc_statement *if_type) return MATCH_ERROR; } - if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: Arithmetic IF " + if (gfc_notify_std (GFC_STD_F95_OBS, "Arithmetic IF " "statement at %C") == FAILURE) return MATCH_ERROR; @@ -1758,7 +1758,7 @@ gfc_match_critical (void) if (gfc_implicit_pure (NULL)) gfc_current_ns->proc_name->attr.implicit_pure = 0; - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: CRITICAL statement at %C") + if (gfc_notify_std (GFC_STD_F2008, "CRITICAL statement at %C") == FAILURE) return MATCH_ERROR; @@ -2382,7 +2382,7 @@ gfc_match_do (void) gfc_forall_iterator *head; gfc_expr *mask; - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: DO CONCURRENT " + if (gfc_notify_std (GFC_STD_F2008, "DO CONCURRENT " "construct at %C") == FAILURE) return MATCH_ERROR; @@ -2581,7 +2581,7 @@ match_exit_cycle (gfc_statement st, gfc_exec_op op) return MATCH_ERROR; } gcc_assert (op == EXEC_EXIT); - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: EXIT statement with no" + if (gfc_notify_std (GFC_STD_F2008, "EXIT statement with no" " do-construct-name at %C") == FAILURE) return MATCH_ERROR; break; @@ -2772,7 +2772,7 @@ gfc_match_pause (void) m = gfc_match_stopcode (ST_PAUSE); if (m == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F95_DEL, "Deleted feature: PAUSE statement" + if (gfc_notify_std (GFC_STD_F95_DEL, "PAUSE statement" " at %C") == FAILURE) m = MATCH_ERROR; @@ -2795,7 +2795,7 @@ gfc_match_stop (void) match gfc_match_error_stop (void) { - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: ERROR STOP statement at %C") + if (gfc_notify_std (GFC_STD_F2008, "ERROR STOP statement at %C") == FAILURE) return MATCH_ERROR; @@ -2977,7 +2977,7 @@ cleanup: match gfc_match_lock (void) { - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: LOCK statement at %C") + if (gfc_notify_std (GFC_STD_F2008, "LOCK statement at %C") == FAILURE) return MATCH_ERROR; @@ -2988,7 +2988,7 @@ gfc_match_lock (void) match gfc_match_unlock (void) { - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: UNLOCK statement at %C") + if (gfc_notify_std (GFC_STD_F2008, "UNLOCK statement at %C") == FAILURE) return MATCH_ERROR; @@ -3021,7 +3021,7 @@ sync_statement (gfc_statement st) if (gfc_implicit_pure (NULL)) gfc_current_ns->proc_name->attr.implicit_pure = 0; - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: SYNC statement at %C") + if (gfc_notify_std (GFC_STD_F2008, "SYNC statement at %C") == FAILURE) return MATCH_ERROR; @@ -3219,7 +3219,7 @@ gfc_match_assign (void) return MATCH_ERROR; if (gfc_match (" to %v%t", &expr) == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F95_DEL, "Deleted feature: ASSIGN " + if (gfc_notify_std (GFC_STD_F95_DEL, "ASSIGN " "statement at %C") == FAILURE) return MATCH_ERROR; @@ -3265,7 +3265,7 @@ gfc_match_goto (void) if (gfc_match_variable (&expr, 0) == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F95_DEL, "Deleted feature: Assigned GOTO " + if (gfc_notify_std (GFC_STD_F95_DEL, "Assigned GOTO " "statement at %C") == FAILURE) return MATCH_ERROR; @@ -3375,7 +3375,7 @@ gfc_match_goto (void) if (gfc_match (" %e%t", &expr) != MATCH_YES) goto syntax; - if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: Computed GOTO " + if (gfc_notify_std (GFC_STD_F95_OBS, "Computed GOTO " "at %C") == FAILURE) return MATCH_ERROR; @@ -3457,7 +3457,7 @@ gfc_match_allocate (void) { if (gfc_match (" :: ") == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: typespec in " + if (gfc_notify_std (GFC_STD_F2003, "typespec in " "ALLOCATE at %L", &old_locus) == FAILURE) goto cleanup; @@ -3620,7 +3620,7 @@ alloc_opt_list: goto cleanup; if (m == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ERRMSG tag at %L", + if (gfc_notify_std (GFC_STD_F2003, "ERRMSG tag at %L", &tmp->where) == FAILURE) goto cleanup; @@ -3644,7 +3644,7 @@ alloc_opt_list: goto cleanup; if (m == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: SOURCE tag at %L", + if (gfc_notify_std (GFC_STD_F2003, "SOURCE tag at %L", &tmp->where) == FAILURE) goto cleanup; @@ -3664,7 +3664,7 @@ alloc_opt_list: } if (head->next - && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: SOURCE tag at %L" + && gfc_notify_std (GFC_STD_F2008, "SOURCE tag at %L" " with more than a single allocate object", &tmp->where) == FAILURE) goto cleanup; @@ -3682,7 +3682,7 @@ alloc_opt_list: goto cleanup; if (m == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: MOLD tag at %L", + if (gfc_notify_std (GFC_STD_F2008, "MOLD tag at %L", &tmp->where) == FAILURE) goto cleanup; @@ -3944,7 +3944,7 @@ dealloc_opt_list: goto cleanup; if (m == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ERRMSG at %L", + if (gfc_notify_std (GFC_STD_F2003, "ERRMSG at %L", &tmp->where) == FAILURE) goto cleanup; @@ -4022,7 +4022,7 @@ gfc_match_return (void) goto cleanup; } - if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: Alternate RETURN " + if (gfc_notify_std (GFC_STD_F95_OBS, "Alternate RETURN " "at %C") == FAILURE) return MATCH_ERROR; @@ -4052,7 +4052,7 @@ cleanup: done: gfc_enclosing_unit (&s); if (s == COMP_PROGRAM - && gfc_notify_std (GFC_STD_GNU, "Extension: RETURN statement in " + && gfc_notify_std (GFC_STD_GNU, "RETURN statement in " "main program at %C") == FAILURE) return MATCH_ERROR; @@ -4966,7 +4966,7 @@ gfc_match_st_function (void) sym->value = expr; - if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: " + if (gfc_notify_std (GFC_STD_F95_OBS, "Statement function at %C") == FAILURE) return MATCH_ERROR; diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 6fe23a28578..88519b71de9 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -553,7 +553,7 @@ gfc_match_use (void) { if ((m = gfc_match (" %n ::", module_nature)) == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: module " + if (gfc_notify_std (GFC_STD_F2003, "module " "nature in USE statement at %C") == FAILURE) goto cleanup; @@ -588,7 +588,7 @@ gfc_match_use (void) { m = gfc_match (" ::"); if (m == MATCH_YES && - gfc_notify_std (GFC_STD_F2003, "Fortran 2003: " + gfc_notify_std (GFC_STD_F2003, "\"USE :: module\" at %C") == FAILURE) goto cleanup; @@ -656,7 +656,7 @@ gfc_match_use (void) m = gfc_match (" =>"); if (type == INTERFACE_USER_OP && m == MATCH_YES - && (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Renaming " + && (gfc_notify_std (GFC_STD_F2003, "Renaming " "operators in USE statements at %C") == FAILURE)) goto cleanup; @@ -6051,7 +6051,7 @@ gfc_use_module (gfc_use_list *module) if (module_fp == NULL && !module->non_intrinsic) { if (strcmp (module_name, "iso_fortran_env") == 0 - && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ISO_FORTRAN_ENV " + && gfc_notify_std (GFC_STD_F2003, "ISO_FORTRAN_ENV " "intrinsic module at %C") != FAILURE) { use_iso_fortran_env_module (); @@ -6061,7 +6061,7 @@ gfc_use_module (gfc_use_list *module) } if (strcmp (module_name, "iso_c_binding") == 0 - && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: " + && gfc_notify_std (GFC_STD_F2003, "ISO_C_BINDING module at %C") != FAILURE) { import_iso_c_binding_module(); diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index ad4e89e9a90..a5d0f85963b 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -1976,7 +1976,7 @@ parse_derived_contains (void) goto error; case ST_PROCEDURE: - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Type-bound" + if (gfc_notify_std (GFC_STD_F2003, "Type-bound" " procedure at %C") == FAILURE) goto error; @@ -1985,7 +1985,7 @@ parse_derived_contains (void) break; case ST_GENERIC: - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: GENERIC binding" + if (gfc_notify_std (GFC_STD_F2003, "GENERIC binding" " at %C") == FAILURE) goto error; @@ -1995,7 +1995,7 @@ parse_derived_contains (void) case ST_FINAL: if (gfc_notify_std (GFC_STD_F2003, - "Fortran 2003: FINAL procedure declaration" + "FINAL procedure declaration" " at %C") == FAILURE) goto error; @@ -2007,7 +2007,7 @@ parse_derived_contains (void) to_finish = true; if (!seen_comps - && (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Derived type " + && (gfc_notify_std (GFC_STD_F2008, "Derived type " "definition at %C with empty CONTAINS " "section") == FAILURE)) goto error; @@ -2112,7 +2112,7 @@ endType: compiling_type = 0; if (!seen_component) - gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Derived type " + gfc_notify_std (GFC_STD_F2003, "Derived type " "definition at %C without components"); accept_statement (ST_END_TYPE); @@ -2166,7 +2166,7 @@ endType: case ST_CONTAINS: gfc_notify_std (GFC_STD_F2003, - "Fortran 2003: CONTAINS block in derived type" + "CONTAINS block in derived type" " definition at %C"); accept_statement (ST_CONTAINS); @@ -3335,7 +3335,7 @@ parse_block_construct (void) gfc_namespace* my_ns; gfc_state_data s; - gfc_notify_std (GFC_STD_F2008, "Fortran 2008: BLOCK construct at %C"); + gfc_notify_std (GFC_STD_F2008, "BLOCK construct at %C"); my_ns = gfc_build_block_ns (gfc_current_ns); @@ -3365,7 +3365,7 @@ parse_associate (void) gfc_statement st; gfc_association_list* a; - gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ASSOCIATE construct at %C"); + gfc_notify_std (GFC_STD_F2003, "ASSOCIATE construct at %C"); my_ns = gfc_build_block_ns (gfc_current_ns); @@ -4095,7 +4095,7 @@ parse_contained (int module) pop_state (); if (!contains_statements) - gfc_notify_std (GFC_STD_F2008, "Fortran 2008: CONTAINS statement without " + gfc_notify_std (GFC_STD_F2008, "CONTAINS statement without " "FUNCTION or SUBROUTINE statement at %C"); } diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 2e71024db4f..e2c3f9917c3 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -269,7 +269,7 @@ match_hollerith_constant (gfc_expr **result) if (match_integer_constant (&e, 0) == MATCH_YES && gfc_match_char ('h') == MATCH_YES) { - if (gfc_notify_std (GFC_STD_LEGACY, "Extension: Hollerith constant " + if (gfc_notify_std (GFC_STD_LEGACY, "Hollerith constant " "at %C") == FAILURE) goto cleanup; @@ -393,7 +393,7 @@ match_boz_constant (gfc_expr **result) goto backup; if (x_hex - && (gfc_notify_std (GFC_STD_GNU, "Extension: Hexadecimal " + && (gfc_notify_std (GFC_STD_GNU, "Hexadecimal " "constant at %C uses non-standard syntax") == FAILURE)) return MATCH_ERROR; @@ -432,7 +432,7 @@ match_boz_constant (gfc_expr **result) goto backup; } - if (gfc_notify_std (GFC_STD_GNU, "Extension: BOZ constant " + if (gfc_notify_std (GFC_STD_GNU, "BOZ constant " "at %C uses non-standard postfix syntax") == FAILURE) return MATCH_ERROR; @@ -469,7 +469,7 @@ match_boz_constant (gfc_expr **result) } if (!gfc_in_match_data () - && (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: BOZ used outside a DATA " + && (gfc_notify_std (GFC_STD_F2003, "BOZ used outside a DATA " "statement at %C") == FAILURE)) return MATCH_ERROR; @@ -560,7 +560,7 @@ match_real_constant (gfc_expr **result, int signflag) if (c == 'q') { - if (gfc_notify_std (GFC_STD_GNU, "Extension: exponent-letter 'q' in " + if (gfc_notify_std (GFC_STD_GNU, "exponent-letter 'q' in " "real-literal-constant at %C") == FAILURE) return MATCH_ERROR; else if (gfc_option.warn_real_q_constant) @@ -1218,7 +1218,7 @@ match_sym_complex_part (gfc_expr **result) return MATCH_ERROR; } - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: PARAMETER symbol in " + if (gfc_notify_std (GFC_STD_F2003, "PARAMETER symbol in " "complex constant at %C") == FAILURE) return MATCH_ERROR; @@ -1646,7 +1646,7 @@ match_arg_list_function (gfc_actual_arglist *result) } } - if (gfc_notify_std (GFC_STD_GNU, "Extension: argument list " + if (gfc_notify_std (GFC_STD_GNU, "argument list " "function at %C") == FAILURE) { m = MATCH_ERROR; @@ -2353,7 +2353,7 @@ build_actual_constructor (gfc_structure_ctor_component **comp_head, { if (comp->initializer) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Structure" + if (gfc_notify_std (GFC_STD_F2003, "Structure" " constructor with missing optional arguments" " at %C") == FAILURE) return FAILURE; @@ -2429,7 +2429,7 @@ gfc_convert_to_structure_constructor (gfc_expr *e, gfc_symbol *sym, gfc_expr **c } if (actual->name) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Structure" + if (gfc_notify_std (GFC_STD_F2003, "Structure" " constructor with named arguments at %C") == FAILURE) goto cleanup; diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index ab79460cc0c..73a9731c0cf 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -331,7 +331,7 @@ resolve_formal_arglist (gfc_symbol *proc) if (proc->attr.function && sym->attr.intent != INTENT_IN) { if (sym->attr.value) - gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Argument '%s'" + gfc_notify_std (GFC_STD_F2008, "Argument '%s'" " of pure function '%s' at %L with VALUE " "attribute but without INTENT(IN)", sym->name, proc->name, &sym->declared_at); @@ -344,7 +344,7 @@ resolve_formal_arglist (gfc_symbol *proc) if (proc->attr.subroutine && sym->attr.intent == INTENT_UNKNOWN) { if (sym->attr.value) - gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Argument '%s'" + gfc_notify_std (GFC_STD_F2008, "Argument '%s'" " of pure subroutine '%s' at %L with VALUE " "attribute but without INTENT", sym->name, proc->name, &sym->declared_at); @@ -723,7 +723,7 @@ resolve_entries (gfc_namespace *ns) && ts->u.cl->length->expr_type == EXPR_CONSTANT && mpz_cmp (ts->u.cl->length->value.integer, fts->u.cl->length->value.integer) != 0))) - gfc_notify_std (GFC_STD_GNU, "Extension: Function %s at %L with " + gfc_notify_std (GFC_STD_GNU, "Function %s at %L with " "entries returning variables of different " "string lengths", ns->entries->sym->name, &ns->entries->sym->declared_at); @@ -916,12 +916,12 @@ resolve_common_blocks (gfc_symtree *common_root) sym->name, &common_root->n.common->where); else if (sym->attr.result || gfc_is_function_return_value (sym, gfc_current_ns)) - gfc_notify_std (GFC_STD_F2003, "Fortran 2003: COMMON block '%s' at %L " + gfc_notify_std (GFC_STD_F2003, "COMMON block '%s' at %L " "that is also a function result", sym->name, &common_root->n.common->where); else if (sym->attr.flavor == FL_PROCEDURE && sym->attr.proc != PROC_INTERNAL && sym->attr.proc != PROC_ST_FUNCTION) - gfc_notify_std (GFC_STD_F2003, "Fortran 2003: COMMON block '%s' at %L " + gfc_notify_std (GFC_STD_F2003, "COMMON block '%s' at %L " "that is also a global procedure", sym->name, &common_root->n.common->where); } @@ -1673,7 +1673,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype, && sym->ns->proc_name->attr.flavor != FL_MODULE) { if (gfc_notify_std (GFC_STD_F2008, - "Fortran 2008: Internal procedure '%s' is" + "Internal procedure '%s' is" " used as actual argument at %L", sym->name, &e->where) == FAILURE) return FAILURE; @@ -4450,7 +4450,7 @@ gfc_resolve_index_1 (gfc_expr *index, int check_scalar, } if (index->ts.type == BT_REAL) - if (gfc_notify_std (GFC_STD_LEGACY, "Extension: REAL array index at %L", + if (gfc_notify_std (GFC_STD_LEGACY, "REAL array index at %L", &index->where) == FAILURE) return FAILURE; @@ -6420,7 +6420,7 @@ gfc_resolve_iterator_expr (gfc_expr *expr, bool real_ok, { if (real_ok) return gfc_notify_std (GFC_STD_F95_DEL, - "Deleted feature: %s at %L must be integer", + "%s at %L must be integer", _(name_msgid), &expr->where); else { @@ -9158,7 +9158,7 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns) rhs = code->expr2; if (rhs->is_boz - && gfc_notify_std (GFC_STD_GNU, "Extension: BOZ literal at %L outside " + && gfc_notify_std (GFC_STD_GNU, "BOZ literal at %L outside " "a DATA statement and outside INT/REAL/DBLE/CMPLX", &code->loc) == FAILURE) return false; @@ -10327,9 +10327,9 @@ resolve_fl_var_and_proc (gfc_symbol *sym, int mp_flag) "a deferred shape", sym->name, &sym->declared_at); return FAILURE; } - else if (gfc_notify_std (GFC_STD_F2003, "Scalar object '%s' at %L " - "may not be ALLOCATABLE", sym->name, - &sym->declared_at) == FAILURE) + else if (gfc_notify_std (GFC_STD_F2003, "Scalar object " + "'%s' at %L may not be ALLOCATABLE", + sym->name, &sym->declared_at) == FAILURE) return FAILURE; } @@ -10423,7 +10423,7 @@ resolve_fl_variable_derived (gfc_symbol *sym, int no_init_flag) && !sym->ns->save_all && !sym->attr.save && !sym->attr.pointer && !sym->attr.allocatable && gfc_has_default_initializer (sym->ts.u.derived) - && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Implied SAVE for " + && gfc_notify_std (GFC_STD_F2008, "Implied SAVE for " "module variable '%s' at %L, needed due to " "the default initialization", sym->name, &sym->declared_at) == FAILURE) @@ -10638,7 +10638,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) && arg->sym->ts.type == BT_DERIVED && !arg->sym->ts.u.derived->attr.use_assoc && !gfc_check_symbol_access (arg->sym->ts.u.derived) - && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: '%s' is of a " + && gfc_notify_std (GFC_STD_F2003, "'%s' is of a " "PRIVATE type and cannot be a dummy argument" " of '%s', which is PUBLIC at %L", arg->sym->name, sym->name, &sym->declared_at) @@ -10660,7 +10660,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) && arg->sym->ts.type == BT_DERIVED && !arg->sym->ts.u.derived->attr.use_assoc && !gfc_check_symbol_access (arg->sym->ts.u.derived) - && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Procedure " + && gfc_notify_std (GFC_STD_F2003, "Procedure " "'%s' in PUBLIC interface '%s' at %L " "takes dummy arguments of '%s' which is " "PRIVATE", iface->sym->name, sym->name, @@ -10684,7 +10684,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) && arg->sym->ts.type == BT_DERIVED && !arg->sym->ts.u.derived->attr.use_assoc && !gfc_check_symbol_access (arg->sym->ts.u.derived) - && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Procedure " + && gfc_notify_std (GFC_STD_F2003, "Procedure " "'%s' in PUBLIC interface '%s' at %L " "takes dummy arguments of '%s' which is " "PRIVATE", iface->sym->name, sym->name, @@ -10772,7 +10772,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) if (!sym->attr.contained && gfc_current_form != FORM_FIXED && !sym->ts.deferred) - gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: " + gfc_notify_std (GFC_STD_F95_OBS, "CHARACTER(*) function '%s' at %L", sym->name, &sym->declared_at); } @@ -11992,7 +11992,7 @@ resolve_fl_derived0 (gfc_symbol *sym) && !is_sym_host_assoc (c->ts.u.derived, sym->ns) && !c->ts.u.derived->attr.use_assoc && !gfc_check_symbol_access (c->ts.u.derived) - && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: the component '%s' " + && gfc_notify_std (GFC_STD_F2003, "the component '%s' " "is a PRIVATE type and cannot be a component of " "'%s', which is PUBLIC at %L", c->name, sym->name, &sym->declared_at) == FAILURE) @@ -12100,7 +12100,7 @@ resolve_fl_derived (gfc_symbol *sym) if (gen_dt && gen_dt->generic && gen_dt->generic->next && (!gen_dt->generic->sym->attr.use_assoc || gen_dt->generic->sym->module != gen_dt->generic->next->sym->module) - && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Generic name '%s' of " + && gfc_notify_std (GFC_STD_F2003, "Generic name '%s' of " "function '%s' at %L being the same name as derived " "type at %L", sym->name, gen_dt->generic->sym == sym @@ -12158,14 +12158,14 @@ resolve_fl_namelist (gfc_symbol *sym) } if (nl->sym->as && nl->sym->as->type == AS_ASSUMED_SHAPE - && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: NAMELIST array " + && gfc_notify_std (GFC_STD_F2003, "NAMELIST array " "object '%s' with assumed shape in namelist " "'%s' at %L", nl->sym->name, sym->name, &sym->declared_at) == FAILURE) return FAILURE; if (is_non_constant_shape_array (nl->sym) - && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: NAMELIST array " + && gfc_notify_std (GFC_STD_F2003, "NAMELIST array " "object '%s' with nonconstant shape in namelist " "'%s' at %L", nl->sym->name, sym->name, &sym->declared_at) == FAILURE) @@ -12174,7 +12174,7 @@ resolve_fl_namelist (gfc_symbol *sym) if (nl->sym->ts.type == BT_CHARACTER && (nl->sym->ts.u.cl->length == NULL || !gfc_is_constant_expr (nl->sym->ts.u.cl->length)) - && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: NAMELIST object " + && gfc_notify_std (GFC_STD_F2003, "NAMELIST object " "'%s' with nonconstant character length in " "namelist '%s' at %L", nl->sym->name, sym->name, &sym->declared_at) == FAILURE) @@ -12194,7 +12194,7 @@ resolve_fl_namelist (gfc_symbol *sym) && (nl->sym->ts.u.derived->attr.alloc_comp || nl->sym->ts.u.derived->attr.pointer_comp)) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: NAMELIST object " + if (gfc_notify_std (GFC_STD_F2003, "NAMELIST object " "'%s' in namelist '%s' at %L with ALLOCATABLE " "or POINTER components", nl->sym->name, sym->name, &sym->declared_at) == FAILURE) @@ -12672,7 +12672,7 @@ resolve_symbol (gfc_symbol *sym) && !sym->ts.u.derived->attr.use_assoc && gfc_check_symbol_access (sym) && !gfc_check_symbol_access (sym->ts.u.derived) - && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: PUBLIC %s '%s' at %L " + && gfc_notify_std (GFC_STD_F2003, "PUBLIC %s '%s' at %L " "of PRIVATE derived type '%s'", (sym->attr.flavor == FL_PARAMETER) ? "parameter" : "variable", sym->name, &sym->declared_at, @@ -13838,7 +13838,7 @@ resolve_fntype (gfc_namespace *ns) && !gfc_check_symbol_access (sym->ts.u.derived) && gfc_check_symbol_access (sym)) { - gfc_notify_std (GFC_STD_F2003, "Fortran 2003: PUBLIC function '%s' at " + gfc_notify_std (GFC_STD_F2003, "PUBLIC function '%s' at " "%L of PRIVATE type '%s'", sym->name, &sym->declared_at, sym->ts.u.derived->name); } diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 99fa27d700e..455e6c98951 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -481,7 +481,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) conf (external, subroutine); if (attr->proc_pointer && gfc_notify_std (GFC_STD_F2003, - "Fortran 2003: Procedure pointer at %C") == FAILURE) + "Procedure pointer at %C") == FAILURE) return FAILURE; conf (allocatable, pointer); @@ -772,13 +772,13 @@ conflict: conflict_std: if (name == NULL) { - return gfc_notify_std (standard, "Fortran 2003: %s attribute " + return gfc_notify_std (standard, "%s attribute " "with %s attribute at %L", a1, a2, where); } else { - return gfc_notify_std (standard, "Fortran 2003: %s attribute " + return gfc_notify_std (standard, "%s attribute " "with %s attribute in '%s' at %L", a1, a2, name, where); } @@ -1597,7 +1597,7 @@ gfc_add_is_bind_c (symbol_attribute *attr, const char *name, locus *where, if (where == NULL) where = &gfc_current_locus; - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: BIND(C) at %L", where) + if (gfc_notify_std (GFC_STD_F2003, "BIND(C) at %L", where) == FAILURE) return FAILURE; @@ -1618,7 +1618,7 @@ gfc_add_extension (symbol_attribute *attr, locus *where) else attr->extension = 1; - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: EXTENDS at %L", where) + if (gfc_notify_std (GFC_STD_F2003, "EXTENDS at %L", where) == FAILURE) return FAILURE; @@ -4746,7 +4746,7 @@ gfc_check_symbol_typed (gfc_symbol* sym, gfc_namespace* ns, } if (gfc_notify_std (GFC_STD_GNU, - "Extension: Symbol '%s' is used before" + "Symbol '%s' is used before" " it is typed at %L", sym->name, &where) == FAILURE) return FAILURE; } |