diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2009-05-07 22:14:23 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2009-05-07 22:14:23 +0000 |
commit | 2995ed9a270259c4fbaa457913860bfab76565c0 (patch) | |
tree | f0ef87ab566aad03fdf5c167d2dba433dcaa3a22 /gcc/fortran/gfortran.texi | |
parent | 13c7a7e5d6ad4e88f5c9c2e9f9d9c5c6baeddcfa (diff) | |
download | gcc-2995ed9a270259c4fbaa457913860bfab76565c0.zip gcc-2995ed9a270259c4fbaa457913860bfab76565c0.tar.gz gcc-2995ed9a270259c4fbaa457913860bfab76565c0.tar.bz2 |
re PR fortran/38830 (Document lack of "Variable Format Expression" support)
PR fortran/38830
* gfortran.texi: Document that we don't support variable FORMAT
expressions.
From-SVN: r147258
Diffstat (limited to 'gcc/fortran/gfortran.texi')
-rw-r--r-- | gcc/fortran/gfortran.texi | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index af1d296..b7c8b82 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 --------------------------------------------------------------------- |