aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorFeng Wang <fengwang@gcc.gnu.org>2005-07-07 07:56:46 +0000
committerFeng Wang <fengwang@gcc.gnu.org>2005-07-07 07:56:46 +0000
commitbc192c773e80f27c8b5a63e8513db9989e2ee545 (patch)
treee8b42ffaeaefd16be8398a4a55662927715c1082 /gcc
parentd3642f893a731c246c8e7d8e8542abbd238daac6 (diff)
downloadgcc-bc192c773e80f27c8b5a63e8513db9989e2ee545.zip
gcc-bc192c773e80f27c8b5a63e8513db9989e2ee545.tar.gz
gcc-bc192c773e80f27c8b5a63e8513db9989e2ee545.tar.bz2
Real commit for Hollerith constants.
From-SVN: r101689
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/gfortran.texi30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index a1bc878..fcd2b0b 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -632,6 +632,7 @@ of extensions, and @option{-std=legacy} allows both without warning.
* Real array indices::
* Unary operators::
* Implicitly interconvert LOGICAL and INTEGER::
+* Hollerith constants support::
@end menu
@node Old-style kind specifications
@@ -804,6 +805,35 @@ converting from INTEGER to LOGICAL, the value zero is interpreted as
i = .FALSE.
@end smallexample
+@node Hollerith constants support
+@section Hollerith constants support
+@cindex Hollerith constants
+
+A Hollerith constant is a string of characters preceded by the letter @samp{H}
+or @samp{h}, and there must be an literal, unsigned, nonzero default integer
+constant indicating the number of characters in the string. Hollerith constants
+are stored as byte strings, one character per byte.
+
+@command{gfortran} supports Hollerith constants. They can be used as the right
+hands in the @code{DATA} statement and @code{ASSIGN} statement, also as the
+arguments. The left hands can be of Integer, Real, Complex and Logical type.
+The constant will be padded or trancated to fit the size of left hand.
+
+Valid Hollerith constants examples:
+@smallexample
+complex*16 x(2)
+data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/
+call foo (4H abc)
+x(1) = 16Habcdefghijklmnop
+@end smallexample
+
+Invalid Hollerith constants examples:
+@smallexample
+integer*4 a
+a = 8H12345678 ! The Hollerith constant is too long. It will be truncated.
+a = 0H ! At least one character needed.
+@end smallexample
+
@include intrinsic.texi
@c ---------------------------------------------------------------------
@c Contributing