From: Janus Weil Date: Fri, 9 Jul 2010 18:40:09 +0000 (+0200) Subject: intrinsic.texi: Add documentation for SAME_TYPE_AS... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6685e80691af987e9fbe94f3e3c92ed29fedeb9e;p=gcc.git intrinsic.texi: Add documentation for SAME_TYPE_AS... 2010-07-09 Janus Weil * intrinsic.texi: Add documentation for SAME_TYPE_AS, EXTENDS_TYPE_OF, STORAGE_SIZE, C_NULL_PTR and C_NULL_FUNPTR. Modify documentation of SIZEOF and C_SIZEOF. From-SVN: r162006 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 1a9e71f29cd..f43a33b30ed 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2010-07-09 Janus Weil + + * intrinsic.texi: Add documentation for SAME_TYPE_AS, EXTENDS_TYPE_OF, + STORAGE_SIZE, C_NULL_PTR and C_NULL_FUNPTR. Modify documentation of + SIZEOF and C_SIZEOF. + 2010-07-08 Janus Weil PR fortran/44649 diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi index 06c6793b2c4..af2f3b2816a 100644 --- a/gcc/fortran/intrinsic.texi +++ b/gcc/fortran/intrinsic.texi @@ -107,6 +107,7 @@ Some basic guidelines for editing this document: * @code{EXIT}: EXIT, Exit the program with status. * @code{EXP}: EXP, Exponential function * @code{EXPONENT}: EXPONENT, Exponent function +* @code{EXTENDS_TYPE_OF}: EXTENDS_TYPE_OF, Query dynamic type for extension * @code{FDATE}: FDATE, Subroutine (or function) to get the current time as a string * @code{FGET}: FGET, Read a single character in stream mode from stdin * @code{FGETC}: FGETC, Read a single character in stream mode @@ -223,6 +224,7 @@ Some basic guidelines for editing this document: * @code{RESHAPE}: RESHAPE, Function to reshape an array * @code{RRSPACING}: RRSPACING, Reciprocal of the relative spacing * @code{RSHIFT}: RSHIFT, Right shift bits +* @code{SAME_TYPE_AS}: SAME_TYPE_AS, Query dynamic types for equality * @code{SCALE}: SCALE, Scale a real value * @code{SCAN}: SCAN, Scan a string for the presence of a set of characters * @code{SECNDS}: SECNDS, Time function @@ -244,6 +246,7 @@ Some basic guidelines for editing this document: * @code{SQRT}: SQRT, Square-root function * @code{SRAND}: SRAND, Reinitialize the random number generator * @code{STAT}: STAT, Get file status +* @code{STORAGE_SIZE}: STORAGE_SIZE, Storage size in bits * @code{SUM}: SUM, Sum of array elements * @code{SYMLNK}: SYMLNK, Create a symbolic link * @code{SYSTEM}: SYSTEM, Execute a shell command @@ -2187,7 +2190,7 @@ Intrinsic function @item @emph{Arguments}: @multitable @columnfractions .15 .70 -@item @var{X} @tab The argument shall be of any type, rank or shape. +@item @var{X} @tab The argument shall be an interoperable data entity. @end multitable @item @emph{Return value}: @@ -2211,7 +2214,7 @@ The example will print @code{.TRUE.} unless you are using a platform where default @code{REAL} variables are unusually padded. @item @emph{See also}: -@ref{SIZEOF} +@ref{SIZEOF}, @ref{STORAGE_SIZE} @end table @@ -3927,6 +3930,42 @@ end program test_exponent +@node EXTENDS_TYPE_OF +@section @code{EXTENDS_TYPE_OF} --- Query dynamic type for extension +@fnindex EXTENDS_TYPE_OF + +@table @asis +@item @emph{Description}: +Query dynamic type for extension. + +@item @emph{Standard}: +Fortran 2003 and later + +@item @emph{Class}: +Inquiry function + +@item @emph{Syntax}: +@code{RESULT = EXTENDS_TYPE_OF(A, MOLD)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .70 +@item @var{A} @tab Shall be an object of extensible declared type or +unlimited polymorphic. +@item @var{MOLD} @tab Shall be an object of extensible declared type or +unlimited polymorphic. +@end multitable + +@item @emph{Return value}: +The return value is a scalar of type default logical. It is true if and only if +the dynamic type of A is an extension type of the dynamic type of MOLD. + + +@item @emph{See also}: +@ref{SAME_TYPE_AS} +@end table + + + @node FDATE @section @code{FDATE} --- Get the current time as a string @fnindex FDATE @@ -9405,6 +9444,42 @@ The return value is of type @code{INTEGER} and of the same kind as +@node SAME_TYPE_AS +@section @code{SAME_TYPE_AS} --- Query dynamic types for equality +@fnindex SAME_TYPE_AS + +@table @asis +@item @emph{Description}: +Query dynamic types for equality. + +@item @emph{Standard}: +Fortran 2003 and later + +@item @emph{Class}: +Inquiry function + +@item @emph{Syntax}: +@code{RESULT = SAME_TYPE_AS(A, B)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .70 +@item @var{A} @tab Shall be an object of extensible declared type or +unlimited polymorphic. +@item @var{B} @tab Shall be an object of extensible declared type or +unlimited polymorphic. +@end multitable + +@item @emph{Return value}: +The return value is a scalar of type default logical. It is true if and +only if the dynamic type of A is the same as the dynamic type of B. + +@item @emph{See also}: +@ref{EXTENDS_TYPE_OF} + +@end table + + + @node SCALE @section @code{SCALE} --- Scale a real value @fnindex SCALE @@ -10146,7 +10221,8 @@ number of bytes occupied by the argument. If the argument has the @code{POINTER} attribute, the number of bytes of the storage area pointed to is returned. If the argument is of a derived type with @code{POINTER} or @code{ALLOCATABLE} components, the return value doesn't account for -the sizes of the data pointed to by these components. +the sizes of the data pointed to by these components. If the argument is +polymorphic, the size according to the declared type is returned. @item @emph{Example}: @smallexample @@ -10159,7 +10235,7 @@ The example will print @code{.TRUE.} unless you are using a platform where default @code{REAL} variables are unusually padded. @item @emph{See also}: -@ref{C_SIZEOF} +@ref{C_SIZEOF}, @ref{STORAGE_SIZE} @end table @@ -10478,6 +10554,37 @@ To stat an open file: @ref{FSTAT}, to stat a link: @ref{LSTAT} +@node STORAGE_SIZE +@section @code{STORAGE_SIZE} --- Storage size in bits +@fnindex STORAGE_SIZE +@cindex storage size + +@table @asis +@item @emph{Description}: +Returns the storage size of argument @var{A} in bits. +@item @emph{Standard}: +Fortran 2008 and later +@item @emph{Class}: +Inquiry function +@item @emph{Syntax}: +@code{RESULT = STORAGE_SIZE(A [, KIND])} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .70 +@item @var{A} @tab Shall be a scalar or array of any type. +@item @var{KIND} @tab (Optional) shall be a scalar integer constant expression. +@end multitable + +@item @emph{Return Value}: +The result is a scalar integer with the kind type parameter specified by KIND (or default integer type if KIND is missing). The result value is the size expressed in bits for an element of an array that +has the dynamic type and type parameters of A. + +@item @emph{See also}: +@ref{C_SIZEOF}, @ref{SIZEOF} +@end table + + + @node SUM @section @code{SUM} --- Sum of array elements @fnindex SUM @@ -10519,7 +10626,7 @@ The result is of the same type as @var{ARRAY}. If @var{DIM} is absent, a scalar with the sum of all elements in @var{ARRAY} is returned. Otherwise, an array of rank n-1, where n equals the rank of -@var{ARRAY},and a shape similar to that of @var{ARRAY} with dimension @var{DIM} +@var{ARRAY}, and a shape similar to that of @var{ARRAY} with dimension @var{DIM} dropped is returned. @item @emph{Example}: @@ -10647,7 +10754,6 @@ Subroutine @item @emph{Syntax}: @code{CALL SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX])} -@item @emph{Arguments}: @item @emph{Arguments}: @multitable @columnfractions .15 .70 @item @var{COUNT} @tab (Optional) shall be a scalar of type default @@ -11658,6 +11764,16 @@ are defined. @item @code{C_VERTICAL_TAB} @tab vertical tab @tab @code{'\v'} @end multitable +Moreover, the following two named constants are defined: + +@multitable @columnfractions .20 .80 +@item Name @tab Type +@item @code{C_NULL_PTR} @tab @code{C_PTR} +@item @code{C_NULL_FUNPTR} @tab @code{C_FUNPTR} +@end multitable + +Both are equivalent to the value @code{NULL} in C. + @node OpenMP Modules OMP_LIB and OMP_LIB_KINDS @section OpenMP Modules @code{OMP_LIB} and @code{OMP_LIB_KINDS} @table @asis