diff options
author | Tobias Burnus <burnus@net-b.de> | 2013-03-11 19:37:30 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2013-03-11 19:37:30 +0100 |
commit | 87f56a65e85ff100e1a813c2bd9c22df615013cd (patch) | |
tree | a125782f4c2f653ab40ff38bd7e42c0593e4017c | |
parent | 2aa953d015925abcd909e22ec48507660efe30aa (diff) | |
download | gcc-87f56a65e85ff100e1a813c2bd9c22df615013cd.zip gcc-87f56a65e85ff100e1a813c2bd9c22df615013cd.tar.gz gcc-87f56a65e85ff100e1a813c2bd9c22df615013cd.tar.bz2 |
gfortran.texi (STRUCTURE and RECORD): State more clearly how to convert them into derived types.
2013-03-11 Tobias Burnus <burnus@net-b.de>
* gfortran.texi (STRUCTURE and RECORD): State more clearly how
to convert them into derived types.
From-SVN: r196602
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/gfortran.texi | 17 |
2 files changed, 18 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e7e5231..88b514d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2013-03-11 Tobias Burnus <burnus@net-b.de> + + * gfortran.texi (STRUCTURE and RECORD): State more clearly how + to convert them into derived types. + 2013-03-10 Paul Thomas <pault@gcc.gnu.org> PR fortran/56575 diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index 462b443..4f9008d 100644 --- a/gcc/fortran/gfortran.texi +++ b/gcc/fortran/gfortran.texi @@ -2004,10 +2004,19 @@ code that uses them running with the GNU Fortran compiler. @cindex @code{STRUCTURE} @cindex @code{RECORD} -Structures are user-defined aggregate data types; this functionality was -standardized in Fortran 90 with an different syntax, under the name of -``derived types''. Here is an example of code using the non portable -structure syntax: +Record structures are a pre-Fortran-90 vendor extension to create +user-defined aggregate data types. GNU Fortran does not support +record structures, only Fortran 90's ``derived types'', which have +a different syntax. + +In many cases, record structures can easily be converted to derived types. +To convert, replace @code{STRUCTURE /}@var{structure-name}@code{/} +by @code{TYPE} @var{type-name}. Additionally, replace +@code{RECORD /}@var{structure-name}@code{/} by +@code{TYPE(}@var{type-name}@code{)}. Finally, in the component access, +replace the period (@code{.}) by the percent sign (@code{%}). + +Here is an example of code using the non portable record structure syntax: @example ! Declaring a structure named ``item'' and containing three fields: |