aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>2005-10-24 11:11:51 +0200
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2005-10-24 09:11:51 +0000
commit4c93c95ac5086b4bb0562e87dcfc338bd4b2225b (patch)
tree0248353a9119382348e932d54cf3de18649875b6 /gcc/fortran/decl.c
parent835681c8a218a2625d97f84c08a3789b373a2336 (diff)
downloadgcc-4c93c95ac5086b4bb0562e87dcfc338bd4b2225b.zip
gcc-4c93c95ac5086b4bb0562e87dcfc338bd4b2225b.tar.gz
gcc-4c93c95ac5086b4bb0562e87dcfc338bd4b2225b.tar.bz2
re PR fortran/15586 (gfortran should support i18n in its compiler messages)
PR fortran/15586 * arith.c (gfc_arith_error): Change message to include locus. (check_result, eval_intrinsic, gfc_int2int, gfc_real2real, gfc_real2complex, gfc_complex2real, gfc_complex2complex): Use the new gfc_arith_error. (arith_error): Rewrite full error messages instead of building them from pieces. * check.c (must_be): Removed. (type_check, numeric_check, int_or_real_check, real_or_complex_check, kind_check, double_check, logical_array_check, array_check, scalar_check, same_type_check, rank_check, kind_value_check, variable_check, gfc_check_allocated, gfc_check_associated, gfc_check_cmplx, gfc_check_dcmplx, gfc_check_dot_product, gfc_check_index, gfc_check_kind, gfc_check_matmul, gfc_check_null, gfc_check_pack, gfc_check_precision, gfc_check_present, gfc_check_spread): Rewrite full error messages instead of building them from pieces. * decl.c (gfc_match_entry): Rewrite full error messages instead of building them from pieces. * parse.c (gfc_state_name): Remove. * parse.h: Remove prototype for gfc_state_name. From-SVN: r105844
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c54
1 files changed, 50 insertions, 4 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 48cb920..69c0fc8 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -2419,11 +2419,57 @@ gfc_match_entry (void)
return m;
state = gfc_current_state ();
- if (state != COMP_SUBROUTINE
- && state != COMP_FUNCTION)
+ if (state != COMP_SUBROUTINE && state != COMP_FUNCTION)
{
- gfc_error ("ENTRY statement at %C cannot appear within %s",
- gfc_state_name (gfc_current_state ()));
+ switch (state)
+ {
+ case COMP_PROGRAM:
+ gfc_error ("ENTRY statement at %C cannot appear within a PROGRAM");
+ break;
+ case COMP_MODULE:
+ gfc_error ("ENTRY statement at %C cannot appear within a MODULE");
+ break;
+ case COMP_BLOCK_DATA:
+ gfc_error
+ ("ENTRY statement at %C cannot appear within a BLOCK DATA");
+ break;
+ case COMP_INTERFACE:
+ gfc_error
+ ("ENTRY statement at %C cannot appear within an INTERFACE");
+ break;
+ case COMP_DERIVED:
+ gfc_error
+ ("ENTRY statement at %C cannot appear "
+ "within a DERIVED TYPE block");
+ break;
+ case COMP_IF:
+ gfc_error
+ ("ENTRY statement at %C cannot appear within an IF-THEN block");
+ break;
+ case COMP_DO:
+ gfc_error
+ ("ENTRY statement at %C cannot appear within a DO block");
+ break;
+ case COMP_SELECT:
+ gfc_error
+ ("ENTRY statement at %C cannot appear within a SELECT block");
+ break;
+ case COMP_FORALL:
+ gfc_error
+ ("ENTRY statement at %C cannot appear within a FORALL block");
+ break;
+ case COMP_WHERE:
+ gfc_error
+ ("ENTRY statement at %C cannot appear within a WHERE block");
+ break;
+ case COMP_CONTAINS:
+ gfc_error
+ ("ENTRY statement at %C cannot appear "
+ "within a contained subprogram");
+ break;
+ default:
+ gfc_internal_error ("gfc_match_entry(): Bad state");
+ }
return MATCH_ERROR;
}