aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2007-04-29 18:42:35 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2007-04-29 18:42:35 +0000
commitb9a666ee429f9ad258b23c1930a1fc860ae184da (patch)
tree5aabbd2e72bd7b381920a856f99ecd1277a9b1d2
parentb378254b7717af81e1bff0589324369691b93319 (diff)
2007-04-29 Steven G. Kargl <kargl@gcc.gnu.org>
* expr.c (gfc_copy_expr): Check if p is_iso_c or is_c_interop. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/fortran-experiments@124285 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/ChangeLog.isocbinding4
-rw-r--r--gcc/fortran/expr.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog.isocbinding b/gcc/fortran/ChangeLog.isocbinding
index ac8682616db..47807fe9d32 100644
--- a/gcc/fortran/ChangeLog.isocbinding
+++ b/gcc/fortran/ChangeLog.isocbinding
@@ -3,6 +3,10 @@ Welcome to the ISO_C_BINDING sandbox!
Please comment here the changes you make to the code, dated with every
commit to the branch, so that we don't get lost.
+2007-04-29 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ * expr.c (gfc_copy_expr): Check if p is_iso_c or is_c_interop.
+
2007-04-28 Tobias Burnus <burnus@net-b.de>
* symbol.c (get_iso_c_binding_dt, gen_special_c_interop_ptr,
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 0e420e3cf47..3abd361ed98 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -447,11 +447,12 @@ gfc_copy_expr (gfc_expr *p)
q->value.character.string = s;
/* This is the case for the C_NULL_CHAR named constant. */
- if (p->value.character.length == 0)
+ if (p->value.character.length == 0
+ && (p->ts.is_c_interop || p->ts.is_iso_c))
{
*s = '\0';
- /* Need to set the length to 1 to make sure the null terminator
- is copied. --Rickett, 02.07.06. */
+ /* Need to set the length to 1 to make sure the NUL terminator
+ is copied. */
q->value.character.length = 1;
}
else