aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/primary.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r--gcc/fortran/primary.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index d7bd6d6..19f97d1 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -3074,6 +3074,12 @@ gfc_convert_to_structure_constructor (gfc_expr *e, gfc_symbol *sym, gfc_expr **c
actual->expr->value.character.length = c;
actual->expr->value.character.string = dest;
+
+ if (warn_line_truncation && c < e)
+ gfc_warning_now (OPT_Wcharacter_truncation,
+ "CHARACTER expression will be truncated "
+ "in constructor (%ld/%ld) at %L", (long int) c,
+ (long int) e, &actual->expr->where);
}
}