aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2009-10-12 00:52:45 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2009-10-12 00:52:45 +0000
commita30595bf4307163e07024b776fa7c8e184962298 (patch)
treea1b6b54ae0aa9567942b0b8a26ecffe11505e66e
parentf4089aae40dd87ad4882af454b3d43bbf7be5648 (diff)
downloadgcc-a30595bf4307163e07024b776fa7c8e184962298.zip
gcc-a30595bf4307163e07024b776fa7c8e184962298.tar.gz
gcc-a30595bf4307163e07024b776fa7c8e184962298.tar.bz2
re PR fortran/38439 (I/O PD edit descriptor inconsistency)
2009-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/38439 * io/format.c (parse_format_list): Correct logic for FMT_F reading vs writing. Code clean-up. From-SVN: r152657
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/format.c11
2 files changed, 10 insertions, 7 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 0984287..b7c75e0 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,6 +1,12 @@
2009-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/38439
+ * io/format.c (parse_format_list): Correct logic for FMT_F reading vs
+ writing. Code clean-up.
+
+2009-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/38439
* io/format.c (parse_format_list): Add check for tokens not allowed
after P specifier. Fix comments. Remove un-needed code. Fix the
default exponent list. Correct pointer assignment error.
diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c
index 7e46e3a..97bd2da 100644
--- a/libgfortran/io/format.c
+++ b/libgfortran/io/format.c
@@ -933,7 +933,7 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
tail->u.real.d = fmt->value;
break;
}
- if (t == FMT_F || dtp->u.p.mode == WRITING)
+ if (t == FMT_F && dtp->u.p.mode == WRITING)
{
if (u != FMT_POSINT && u != FMT_ZERO)
{
@@ -941,13 +941,10 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok)
goto finished;
}
}
- else
+ else if (u != FMT_POSINT)
{
- if (u != FMT_POSINT)
- {
- fmt->error = posint_required;
- goto finished;
- }
+ fmt->error = posint_required;
+ goto finished;
}
tail->u.real.w = fmt->value;