diff options
author | Tobias Schlüter <tobi@gcc.gnu.org> | 2007-09-27 23:27:51 +0200 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2007-09-27 23:27:51 +0200 |
commit | 7e49f9653784a0683e7e7f5d52daa1de081b7a14 (patch) | |
tree | c8c963b4e7930274695f7cb023f990e51a9c4cda /gcc/fortran | |
parent | 0da4c1ea8461992bef38a5ad49e9e5e67fd5a495 (diff) | |
download | gcc-7e49f9653784a0683e7e7f5d52daa1de081b7a14.zip gcc-7e49f9653784a0683e7e7f5d52daa1de081b7a14.tar.gz gcc-7e49f9653784a0683e7e7f5d52daa1de081b7a14.tar.bz2 |
arith.c (reduce_binary_aa): Fix capitalization.
fortran/
* arith.c (reduce_binary_aa): Fix capitalization.
* check.c (gfc_check_dot_product): Likewise.
(gfc_check_matmul): Likewise.
* expr.c (gfc_check_conformance): Likewise.
(gfc_check_assign): Likewise.
(gfc_default_initializer): Simplify logic.
* trans.c (gfc_msg_bounds): Make const.
(gfc_msg_fault): Likewise.
(gfc_msg_wrong_return): Likewise.
* trans.h: Add const to corresponding extern declarations.
testsuite/
* gfortran.dg/array_initializer_3.f90: Adapt error annotations for
fixed capitalizations.
* gfortran.dg/compliant_elemental_intrinsics_1.f90: Likewise.
* gfortran.dg/compliant_elemental_intrinsics_2.f90: Likewise.
* gfortran.dg/elemental_subroutine_4.f90: Likewise.
* gfortran.dg/intrinsic_argument_conformance_1.f90: Likewise.
* gfortran.dg/maxloc_shape_1.f90: Likewise.
* gfortran.dg/maxval_maxloc_conformance_1.f90: Likewise.
* gfortran.dg/min_max_conformance.f90: Likewise.
From-SVN: r128849
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/fortran/arith.c | 2 | ||||
-rw-r--r-- | gcc/fortran/check.c | 6 | ||||
-rw-r--r-- | gcc/fortran/expr.c | 18 | ||||
-rw-r--r-- | gcc/fortran/trans.c | 6 | ||||
-rw-r--r-- | gcc/fortran/trans.h | 6 |
6 files changed, 31 insertions, 20 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 1e06226..4940366 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,16 @@ +2007-09-27 Tobias Schlüter <tobi@gcc.gnu.org> + + * arith.c (reduce_binary_aa): Fix capitalization. + * check.c (gfc_check_dot_product): Likewise. + (gfc_check_matmul): Likewise. + * expr.c (gfc_check_conformance): Likewise. + (gfc_check_assign): Likewise. + (gfc_default_initializer): Simplify logic. + * trans.c (gfc_msg_bounds): Make const. + (gfc_msg_fault): Likewise. + (gfc_msg_wrong_return): Likewise. + * trans.h: Add const to corresponding extern declarations. + 2007-09-27 Paul Thomas <pault@gcc.gnu.org> PR fortran/33568 diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c index 7e3d0a4..97d093f 100644 --- a/gcc/fortran/arith.c +++ b/gcc/fortran/arith.c @@ -1422,7 +1422,7 @@ reduce_binary_aa (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **), rc = ARITH_OK; d = op2->value.constructor; - if (gfc_check_conformance ("Elemental binary operation", op1, op2) + if (gfc_check_conformance ("elemental binary operation", op1, op2) != SUCCESS) rc = ARITH_INCOMMENSURATE; else diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index 6f6a805..b6c47da 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -957,7 +957,7 @@ gfc_check_dot_product (gfc_expr *vector_a, gfc_expr *vector_b) if (! identical_dimen_shape (vector_a, 0, vector_b, 0)) { - gfc_error ("different shape for arguments '%s' and '%s' at %L for " + gfc_error ("Different shape for arguments '%s' and '%s' at %L for " "intrinsic 'dot_product'", gfc_current_intrinsic_arg[0], gfc_current_intrinsic_arg[1], &vector_a->where); return FAILURE; @@ -1676,7 +1676,7 @@ gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b) /* Check for case matrix_a has shape(m), matrix_b has shape (m, k). */ if (!identical_dimen_shape (matrix_a, 0, matrix_b, 0)) { - gfc_error ("different shape on dimension 1 for arguments '%s' " + gfc_error ("Different shape on dimension 1 for arguments '%s' " "and '%s' at %L for intrinsic matmul", gfc_current_intrinsic_arg[0], gfc_current_intrinsic_arg[1], &matrix_a->where); @@ -1695,7 +1695,7 @@ gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b) - matrix_a has shape (n,m) and matrix_b has shape (m). */ if (!identical_dimen_shape (matrix_a, 1, matrix_b, 0)) { - gfc_error ("different shape on dimension 2 for argument '%s' and " + gfc_error ("Different shape on dimension 2 for argument '%s' and " "dimension 1 for argument '%s' at %L for intrinsic " "matmul", gfc_current_intrinsic_arg[0], gfc_current_intrinsic_arg[1], &matrix_a->where); diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 815612e..0c68095 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -2556,8 +2556,8 @@ gfc_check_conformance (const char *optype_msgid, gfc_expr *op1, gfc_expr *op2) if (op1_flag && op2_flag && mpz_cmp (op1_size, op2_size) != 0) { - gfc_error ("different shape for %s at %L on dimension %d (%d and %d)", - _(optype_msgid), &op1->where, d + 1, + gfc_error ("Different shape for %s at %L on dimension %d " + "(%d and %d)", _(optype_msgid), &op1->where, d + 1, (int) mpz_get_si (op1_size), (int) mpz_get_si (op2_size)); @@ -2696,7 +2696,7 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform) /* Check size of array assignments. */ if (lvalue->rank != 0 && rvalue->rank != 0 - && gfc_check_conformance ("Array assignment", lvalue, rvalue) != SUCCESS) + && gfc_check_conformance ("array assignment", lvalue, rvalue) != SUCCESS) return FAILURE; if (gfc_compare_types (&lvalue->ts, &rvalue->ts)) @@ -2905,22 +2905,20 @@ gfc_default_initializer (gfc_typespec *ts) gfc_expr *init; gfc_component *c; - init = NULL; - /* See if we have a default initializer. */ for (c = ts->derived->components; c; c = c->next) - { - if ((c->initializer || c->allocatable) && init == NULL) - init = gfc_get_expr (); - } + if (c->initializer || c->allocatable) + break; - if (init == NULL) + if (!c) return NULL; /* Build the constructor. */ + init = gfc_get_expr (); init->expr_type = EXPR_STRUCTURE; init->ts = *ts; init->where = ts->derived->declared_at; + tail = NULL; for (c = ts->derived->components; c; c = c->next) { diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index 0d036aa..d2e2b5a 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -46,9 +46,9 @@ along with GCC; see the file COPYING3. If not see static gfc_file *gfc_current_backend_file; -char gfc_msg_bounds[] = N_("Array bound mismatch"); -char gfc_msg_fault[] = N_("Array reference out of bounds"); -char gfc_msg_wrong_return[] = N_("Incorrect function return value"); +const char gfc_msg_bounds[] = N_("Array bound mismatch"); +const char gfc_msg_fault[] = N_("Array reference out of bounds"); +const char gfc_msg_wrong_return[] = N_("Incorrect function return value"); /* Advance along TREE_CHAIN n times. */ diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index 58bdf3d..7bff3aa 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -716,9 +716,9 @@ void gfc_apply_interface_mapping (gfc_interface_mapping *, /* Standard error messages used in all the trans-*.c files. */ -extern char gfc_msg_bounds[]; -extern char gfc_msg_fault[]; -extern char gfc_msg_wrong_return[]; +extern const char gfc_msg_bounds[]; +extern const char gfc_msg_fault[]; +extern const char gfc_msg_wrong_return[]; #endif /* GFC_TRANS_H */ |