summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-07 22:14:23 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-07 22:14:23 +0000
commitb00f78756b1cd3e6a4dfa2e705b5776b16d1cec2 (patch)
treef0ef87ab566aad03fdf5c167d2dba433dcaa3a22
parent5fde53e5199a5e2082957bcce08c0de14055e83d (diff)
downloadgcc-b00f78756b1cd3e6a4dfa2e705b5776b16d1cec2.tar.gz
PR fortran/38830
* gfortran.texi: Document that we don't support variable FORMAT expressions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147258 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/gfortran.texi47
2 files changed, 52 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index cf4f969938f..219a1abf2d7 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,11 @@
2009-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+ PR fortran/38830
+ * gfortran.texi: Document that we don't support variable FORMAT
+ expressions.
+
+2009-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
PR fortran/39576
* error.c (error_print): Add missing break statement.
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index af1d2961085..b7c8b82537c 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -1641,7 +1641,7 @@ code that uses them running with the GNU Fortran compiler.
* STRUCTURE and RECORD::
@c * UNION and MAP::
* ENCODE and DECODE statements::
-@c * Expressions in FORMAT statements::
+* Variable FORMAT expressions::
@c * Q edit descriptor::
@c * AUTOMATIC statement::
@c * TYPE and ACCEPT I/O Statements::
@@ -1779,6 +1779,51 @@ c ... Code that sets A, B and C
@end smallexample
+@node Variable FORMAT expressions
+@subsection Variable @code{FORMAT} expressions
+@cindex @code{FORMAT}
+
+A variable @code{FORMAT} expression is format statement which includes
+angle brackets enclosing a Fortran expression: @code{FORMAT(I<N>)}. GNU
+Fortran does not support this legacy extension. The effect of variable
+format expressions can be reproduced by using the more powerful (and
+standard) combination of internal output and string formats. For example,
+replace a code fragment like this:
+
+@smallexample
+ WRITE(6,20) INT1
+ 20 FORMAT(I<N+1>)
+@end smallexample
+
+@noindent
+with the following:
+
+@smallexample
+c Variable declaration
+ CHARACTER(LEN=20) F
+c
+c Other code here...
+c
+ WRITE(FMT,'("(I", I0, ")")') N+1
+ WRITE(6,FM) INT1
+@end smallexample
+
+@noindent
+or with:
+
+@smallexample
+c Variable declaration
+ CHARACTER(LEN=20) FMT
+c
+c Other code here...
+c
+ WRITE(FMT,*) N+1
+ WRITE(6,"(I" // ADJUSTL(FMT) // ")") INT1
+@end smallexample
+
+
+
+
@c ---------------------------------------------------------------------
@c Intrinsic Procedures
@c ---------------------------------------------------------------------