This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch,Fortran] Update gfortran.texi for mixed-language programming


Hello all,

I did some clean up of gfortran.texi in the introduction,
mention two modules which can be used to get Fortran 95
Part 2 working (varying string length; part 3 (coco) has
already a reference).  And the largest change is a new
chapter on mixed-language programming.

While doing the clean up, I saw that only INT_FAST128_T
remained unsupported. I decided it can be trivally
implemented as being the same as INT128_T and thus I did.

Build on x86-64-linux. OK for the trunk?

Tobias

PS: Please proof read. I did a couple of times, found
several typos, but I think there are more language and
maybe also content bugs hidden.
2009-05-31  Tobias Burnus  <burnus@net-b.de>

	* gfortran.texi: Add mixed-language programming, mention
	varying string lengths, some clean up of introduction parts.
	* intrinsic.texi (instrinsic modules): Create @menu for
	subsections.
	(ISO_C_BINDING): Support ISOCBINDING_INT_FAST128_T.
	* libgfortran.h: Comment to rember to keep gfortran.texi
	in sync.
	* iso-c-binding.def: Support ISOCBINDING_INT_FAST128_T.

Index: gfortran.texi
===================================================================
--- gfortran.texi	(Revision 148016)
+++ gfortran.texi	(Arbeitskopie)
@@ -182,6 +182,7 @@
 Part II: Language Reference
 * Fortran 2003 and 2008 status::  Fortran 2003 and 2008 features supported by GNU Fortran.
 * Compiler Characteristics::      KIND type parameters supported.
+* Mixed-language programming::    Interoperability with C
 * Extensions::           Language extensions implemented by GNU Fortran.
 * Intrinsic Procedures:: Intrinsic procedures supported by GNU Fortran.
 * Intrinsic Modules::    Intrinsic modules supported by GNU Fortran.
@@ -240,13 +241,11 @@
 @node About GNU Fortran
 @section About GNU Fortran
 
-The GNU Fortran compiler is still in an early state of development.
-It can generate code for most constructs and expressions,
-but much work remains to be done.
+The GNU Fortran compiler supports the Fortran 77, 90 and 95 standards
+completely, parts of the Fortran 2003 and Fortran 2008 standards, and
+several vendor extensions. The development goal is to provide the
+following features:
 
-When the GNU Fortran compiler is finished,
-it will do everything you expect from any decent compiler: 
-
 @itemize @bullet
 @item
 Read a user's program,
@@ -504,7 +503,7 @@
 categories: bug fixing (primarily regarding the treatment of invalid code
 and providing useful error messages), improving the compiler optimizations
 and the performance of compiled code, and extending the compiler to support
-future standards---in particular, Fortran 2003.
+future standards---in particular, Fortran 2003 and Fortran 2008.
 
 
 @c ---------------------------------------------------------------------
@@ -515,6 +514,10 @@
 @section Standards
 @cindex Standards
 
+@menu
+* Varying length character strings::
+@end menu
+
 The GNU Fortran compiler implements
 ISO/IEC 1539:1997 (Fortran 95).  As such, it can also compile essentially all
 standard-compliant Fortran 90 and Fortran 77 programs.   It also supports
@@ -528,14 +531,31 @@
 support is reported in the @ref{Fortran 2003 status} section of the
 documentation.
 
-The next version of the Fortran standard after Fortran 2003 is currently
+The next version of the Fortran standard (Fortran 2008) is currently
 being developed and the GNU Fortran compiler supports some of its new
 features. This support is based on the latest draft of the standard
 (available from @url{http://www.nag.co.uk/sc22wg5/}) and no guarantee of
 future compatibility is made, as the final standard might differ from the
 draft. For more information, see the @ref{Fortran 2008 status} section.
 
+Additionally, the GNU Fortran compilers supports the OpenMP specification
+(version 3.0, @url{http://openmp.org/wp/openmp-specifications/}).
 
+@node Varying length character strings
+@subsection Varying length character strings
+@cindex Varying length character strings
+@cindex Varying length strings
+@cindex strings, varying length
+
+The Fortran 95 standard specifies in Part 2 (ISO/IEC 1539-2:2000)
+varying length character strings. While GNU Fortran currently does not
+support such strings directly, there exist two Fortran implementation
+for them, which work with GNU Fortran. They can be found at
+@uref{http://www.fortran.com/iso_varying_string.f95} and at
+@uref{ftp://ftp.nag.co.uk/sc22wg5/ISO_VARYING_STRING/}.
+
+
+
 @c =====================================================================
 @c PART I: INVOCATION REFERENCE
 @c =====================================================================
@@ -787,9 +807,9 @@
 @node Fortran 2003 status
 @section Fortran 2003 status
 
-Although GNU Fortran focuses on implementing the Fortran 95
-standard for the time being, a few Fortran 2003 features are currently
-available.
+GNU Fortran supports the several Fortran 2003 features; an incomplete
+list can be found below.
+The following, i
 
 @itemize
 @item 
@@ -1529,8 +1549,8 @@
 and environment variables that influence run-time behavior.
 
 GNU Fortran strives to be compatible to the 
-@uref{http://www.openmp.org/drupal/mp-documents/spec25.pdf,
-OpenMP Application Program Interface v2.5}.
+@uref{http://www.openmp.org/mp-documents/spec30.pdf,
+OpenMP Application Program Interface v3.0}.
 
 To enable the processing of the OpenMP directive @code{!$omp} in
 free-form source code; the @code{c$omp}, @code{*$omp} and @code{!$omp}
@@ -1822,9 +1842,504 @@
 @end smallexample
 
 
+@c ---------------------------------------------------------------------
+@c Mixed-language programming
+@c ---------------------------------------------------------------------
 
+@node Mixed-language programming
+@chapter Mixed-language programming
+@cindex Interoperability
+@cindex Mixed-language programming
 
-@c ---------------------------------------------------------------------
+@menu
+* Interoperability with C::
+* Non-Fortran main program::
+@end menu
+
+This chapter is about mixed-language interoperability, but also applies
+if one links Fortran code compiled by different compilers. In most cases
+using the C Binding features of the Fortran 2003 standard is sufficient
+and its use is highly recommended.
+
+
+@node Interoperability with C
+@section Interoperability with C
+
+@menu
+* Intrinsic Types::
+* Further Interoperability of Fortran with C::
+* Derived Types and struct::
+* Interoperable Global variables::
+* Interoperable Subroutines and Functions::
+@end menu
+
+Since Fortran 2003 (ISO/IEC 1539-1:2004(E)) there is a
+standardized way to generate procedure and derived-type
+declarations and global variables which are interoperable with C
+(ISO/IEC 9899:1999). The the bind(C) attribute has been added
+to inform the compiler that a symbol shall be interoperable with C;
+additionally some constrains are added. Note, however, that not
+all C features have a Fortran equivalent or vice versa. For instance,
+neither C's signed integers nor C's functions with variable number
+of arguments have an equivalent in Fortran.
+
+
+@node Intrinsic Types
+@subsection Intrinsic Types
+
+In order to ensure that one uses exactly the same variable type and kind
+in C and Fortran, one should use as kind parameter the named constants
+defined in the @code{ISO_C_BINDING} intrinsic module. The module contains
+additionally character named constants for character literals which are
+available via escape sequences in C. The kind and character named constants
+can be found in @ref{ISO_C_BINDING}.
+
+@node Derived Types and struct
+@subsection Derived Types and struct
+
+For compatibility of derived types with @code{struct}, one needs to use
+the @code{BIND(C)} attribute in the type declaration. For instance the
+following type declaration
+
+@smallexample
+ USE ISO_C_BINDING
+ TYPE, BIND(C) :: myType
+   INTEGER(C_INT) :: i1, i2
+   INTEGER(C_SIGNED_CHAR) :: i3
+   REAL(C_DOUBLE) :: d1
+   COMPLEX(C_FLOAT_COMPLEX) :: c1
+   CHARACTER(KIND=C_CHAR) :: str(5)
+ END TYPE
+@end smallexample
+
+matches the following @code{struct} declaration in C
+
+@smallexample
+ struct @{
+   int i1, i2;
+   /* Note: "char" might be signed or unsigned.  */
+   signed char i3;
+   double d1;
+   float _Complex c1;
+   char str[5];
+ @} myType;
+@end smallexample
+
+Derived types with the C binding attribute cannot have the sequence
+attribute, type parameters, the extends attribute, type-bound procedures,
+and every component must be of interoperable type and kind and may not
+have the pointer or allocatable attribute. The name of the variables is
+irrelevant for the interoperability.
+
+As there exists no direct Fortran equivalent, structs with bit field
+and variable-length array members, and unions are not interoperable.
+
+@node Interoperable Global variables
+@subsection Interoperable Global variables
+
+Variables can be made accessible from C using the C binding attribute,
+optionally together with specifying a binding name. Those variables
+have to be declared in the declaration part of a @code{MODULE} and
+shall be of interoperable type and neither pointers nor allocatable.
+
+@smallexample
+  MODULE m
+    USE myType_module
+    USE ISO_C_BINDING
+    integer(C_INT), bind(C, name="_MyProject_flags") :: global_flag
+    type(myType), bind(C) :: tp
+  END MODULE
+@end smallexample
+
+Here, @code{_MyProject_flags} is the case-sensitive name of the variable
+as seen from C programs while @code{global_flag} is the case-insensitive
+name as seen from Fortran. If no binding name is specified, as for
+@var{tp}, the C binding name is the (lowercase) Fortran binding name.
+If a binding name is specified, only a single variable may be after the
+double colon. Note of warning: You can not use a global variable to
+access @var{errno} of the C library as the C standard allows it to be
+a macro. Use the @code{IERRNO} intrinsic (GNU extension) instead.
+
+@node Interoperable Subroutines and Functions
+@subsection Interoperable Subroutines and Functions
+
+Subroutines and functions have to have the @code{BIND(C)} attribute to
+be compatible with C. The dummy-argument declaration is relatively
+streight forward. However, one needs to be careful because C uses by
+default call-by-value while Fortran uses call-by-reference. Additionally,
+strings and pointers are handled different. Note that only explicit
+size and assumed-size arrays are supported but not assumed-shape or
+allocatable arrays.
+
+To pass a variable by value, one uses the @code{VALUE} attribute.
+Thus the following C prototype
+
+@smallexample
+@code{int func(int i, int *j)}
+@end smallexample
+
+matches the Fortran declaration
+
+@smallexample
+  integer(c_int) func(i,j)
+    integer, VALUE :: i
+    integer :: j
+@end smallexample
+
+Note that frequently also the pointer argument needs the
+@code{VALUE} attribute.
+
+Strings are handled quite differently in C and Fortran. In C a string
+is a NULL terminated arrays of characters while in Fortran each string
+has a length associated and is thus not terminated (by e.g. NULL).
+For example, if one wants to use the following C function,
+
+@smallexample
+  #include <stdio.h>
+  void print_C(char *string) /* equivalent: char string[]  */
+  @{
+     printf("%s\n", string);
+  @}
+@end smallexample
+
+to print "Hello World" from Fortran, one can call it using
+
+@smallexample
+  use iso_c_binding, only: C_CHAR, C_NULL_CHAR
+  interface
+    subroutine print_c(string) bind(C, name="print_C")
+      use iso_c_binding, only: c_char
+      character(kind=c_char) :: string(*)
+    end subroutine print_c
+  end interface
+  call print_c(C_CHAR_"Hello World"//C_NULL_CHAR)
+@end smallexample
+
+As the example shows, one needs to take care oneself that the
+string is NULL terminated. Additionally, the dummy argument
+@var{string} of @code{print_C} is a length-one assumed-size
+array; using @code{character(len=*)} is not allowed. The example
+above uses @code{c_char_"Hello World"} to ensure the string
+literal has the right type; typically the default character
+kind and @code{c_char} are the same and thus @code{"Hello World"}
+is equivalent. However, the standard does not guarantee this.
+
+The use of pointers is now illustrated using the C library
+function @code{strncpy}, whose prototype is
+
+@smallexample
+  char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
+@end smallexample
+
+The function @code{strncpy} copies maximally @var{n} characters from
+string @var{s2} to @var{s1} and returns @var{s1}. In the following
+example, we ignore the return value:
+
+@smallexample
+  use iso_c_binding
+  implicit none
+  character(len=30) :: str,str2
+  interface
+    ! Ignore the return value of strncpy -> subroutine
+    ! "restrict" is always assumed if we do not pass a pointer
+    subroutine strncpy(dest, src, n) bind(C)
+      import
+      character(kind=c_char),  intent(out) :: dest(*)
+      character(kind=c_char),  intent(in)  :: src(*)
+      integer(c_size_t), value, intent(in) :: n
+    end subroutine strncpy
+  end interface
+  str = repeat('X',30) ! Initialize whole string with 'X'
+  call strncpy(str, c_char_"Hello World"//C_NULL_CHAR, &
+               len(c_char_"Hello World",kind=c_size_t))
+  print '(a)', str ! prints: "Hello WorldXXXXXXXXXXXXXXXXXXX"
+  end
+@end smallexample
+
+C pointers are represented in Fortran via the special derived type
+@code{type(c_ptr)}, with private components. Thus one needs to
+use intrinsic conversion procedures to convert from/to C pointers.
+For example,
+
+@smallexample
+  use iso_c_binding
+  type(c_ptr) :: cptr1, cptr2
+  integer, target :: array(7), scalar
+  integer, pointer :: pa(:), ps
+  cptr1 = c_loc(array(1)) ! The programmer needs to ensure that the
+                          ! array is contiguous if required by the C
+                          ! procedure
+  cptr2 = c_loc(scalar)
+  call c_f_pointer(cptr2, ps)
+  call c_f_pointer(cptr2, pa, shape=[7])
+@end smallexample
+
+When converting C to Fortran arrays, the one-dimensional @code{SHAPE} argument
+has to be passed. Note: A pointer argument @code{void *} matches
+@code{TYPE(C_PTR), VALUE} while @code{TYPE(C_PTR)} matches @code{void **}.
+
+Procedure pointers are handled analogously to pointers; the C type is
+@code{TYPE(C_FUNPTR)} and the intrinsic conversion procedures are
+@code{C_F_PROC_POINTER} and @code{C_FUNLOC}.
+
+The intrinsic procedures are described in @ref{Intrinsic Procedures}.
+
+@node Further Interoperability of Fortran with C
+@subsection Further Interoperability of Fortran with C
+
+Assumed-shape and allocatable arrays are passed using an array descriptor
+(dope vector). The internal structure of the array descriptor used
+by gfortran is not yet documented and will change. There will also be
+a Technical Report (TR 29113) which standardizes an interoperable
+array descriptor. Until then, you can use the
+@url{http://chasm-interop.sourceforge.net/} which provides an interface to
+GNU Fortran's array descriptor.
+
+The technical report 29113 will presumably also include support for
+@code{OPTIONAL}, assumed-rank and assumed-type variables. However, the TR
+has neither been approved nor implemented in GNU Fortran; therefore
+theses features are not yet available.
+
+@node Non-Fortran main program
+@section Non-Fortran main program
+
+@menu
+* _gfortran_set_args:: Save command-line arguments
+* _gfortran_set_options:: Set library option flags
+* _gfortran_set_convert:: Set endian conversion
+* _gfortran_set_record_marker:: Set length of record markers
+* _gfortran_set_max_subrecord_length:: Set subrecord length
+@end menu
+
+Even if you are doing mixed-language programming, it is very
+likely that you do not need to know or use the information in this
+section. Since it is about the internal structure of gfortran,
+it may also change in GCC minor releases.
+
+When you compile a @code{PROGRAM} with GNU Fortran, a function
+with the name @code{main} (in the symbol table of the object file)
+is generated, which initializes the libgfortran library and then
+calls the actual program which has due to historic reasons the
+name @code{MAIN__}. If you link GNU Fortran compiled procedures
+to, e.g., a C or C++ program or to a Fortran program compiled by
+a different compiler, the libgfortran library is not initialize
+and thus a few intrinsic procedures do not work properly, e.g.
+those for obtaining the command-line arguments.
+
+Therefore, if your @code{PROGRAM} is not compiled with
+GNU Fortran and the GNU Fortran compiled procedures require
+intrinsics relying on the library initialization, you need to
+initialize the library yourselve. Using the default options,
+gfortran calls @code{_gfortran_set_args} and
+@code{_gfortran_set_options}. The initialization of the former
+is needed if the called procedures access the command line
+(and for backtracing); the latter sets some flags based on the
+standard choosen or to enable backtracing. In typical programs,
+it is not necessary to call any initialization function.
+
+If your @code{PROGRAM} is compiled with GNU Fortran, you shall
+not call any of the following functions. The libgfortran
+initialization functions are shown in C syntax but using C
+bindings they are also accessible from Fortran.
+
+
+@node _gfortran_set_args
+@subsection @code{_gfortran_set_args} --- Save command-line arguments
+@fnindex _gfortran_set_args
+@cindex libgfortran initialization, set_args
+
+@table @asis
+@item @emph{Description}:
+@code{_gfortran_set_args} saves the command-line arguments; this
+initialization is required if any of the command-line intrinsics
+is called. Additionally, it shall be called if backtracing is
+enabled (see @code{_gfortran_set_options}).
+
+@item @emph{Syntax}:
+@code{void _gfortran_set_args (int argc, char *argv[])}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{argc} @tab number of command line argument strings
+@item @var{argv} @tab the command-line argument strings; argv[0]
+is the pathname of the executable itself.
+@end multitable
+
+@item @emph{Example}:
+@smallexample
+int main (int argc, char *argv[])
+@{
+  /* Initialize libgfortran.  */
+  _gfortran_set_args (argc, argv);
+  return 0;
+@}
+@end smallexample
+@end table
+
+
+@node _gfortran_set_options
+@subsection @code{_gfortran_set_options} --- Set library option flags
+@fnindex _gfortran_set_options
+@cindex libgfortran initialization, set_options
+
+@table @asis
+@item @emph{Description}:
+@code{_gfortran_set_options} sets several flags related to the Fortran
+standard to be used, whether backtracing or coredumping should be enabled
+or whether range-checks should be performed. The syntax allows for
+upward compatibility since the number of passed flags is specified; for
+non-passed flags, the default value is used. More about the options
+can be found in the compiler-option section of this manual. Please
+note that not all flags are actually used.
+
+@item @emph{Syntax}:
+@code{void _gfortran_set_options (int num, int options[])}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{num} @tab number of options passed
+@item @var{argv} @tab The list of flag values
+@end multitable
+
+@item @emph{option flag list}:
+@multitable @columnfractions .15 .70
+@item @var{option}[0] @tab Allowed standard; can give run-time errors
+if e.g. an input-output edit descriptor is invalid in a given standard.
+Possible values are (bitwise or-ed) @code{GFC_STD_F77} (1),
+@code{GFC_STD_F95_OBS} (2), @code{GFC_STD_F95_DEL} (4), @code{GFC_STD_F95}
+(8), @code{GFC_STD_F2003} (16), @code{GFC_STD_GNU} (32),
+@code{GFC_STD_LEGACY} (64), and @code{GFC_STD_F2008} (128).
+Default: @code{GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_F2003
+| GFC_STD_F2008 | GFC_STD_F95 | GFC_STD_F77 | GFC_STD_GNU | GFC_STD_LEGACY}.
+@item @var{option}[1] @tab Standard-warning flag; prints a warning to
+standard error. Default: @code{GFC_STD_F95_DEL | GFC_STD_LEGACY}.
+@item @var{option}[2] @tab If non zero, enable pedantic checking.
+Default: off.
+@item @var{option}[3] @tab If non zero, enable coredumping on run-time
+errors. Default: off.
+@item @var{option}[4] @tab If non zero, enable backtracing on run-time
+errors. Default: off.
+Note: Installs a signal handler and requires that command-line
+initialization using @code{_gfortran_set_args}.
+@item @var{option}[5] @tab If non zero, supports signed zeros.
+Default: enabled.
+@item @var{option}[6] @tab Enables run-time checking. Possible values
+are (bitwise or-ed): GFC_RTCHECK_BOUNDS (1), GFC_RTCHECK_ARRAY_TEMPS (2),
+GFC_RTCHECK_RECURSION (4), GFC_RTCHECK_DO (16).
+Default: disabled.
+@item @var{option}[7] @tab If non zero, range checking is enabled.
+Default: enabled. See -frange-check (@pxref{Code Gen Options}).
+@end multitable
+
+@item @emph{Example}:
+@smallexample
+  /* Use gfortran 4.5 default options.  */
+  static int options[] = @{68, 255, 0, 0, 0, 1, 0, 1@};
+  _gfortran_set_options (8, &options);
+@end smallexample
+@end table
+
+
+@node _gfortran_set_convert
+@subsection @code{_gfortran_set_convert} --- Set endian conversion
+@fnindex _gfortran_set_convert
+@cindex libgfortran initialization, set_convert
+
+@table @asis
+@item @emph{Description}:
+@code{_gfortran_set_convert} set the used the representation
+of data for unformatted files.
+
+@item @emph{Syntax}:
+@code{void _gfortran_set_convert (int conv)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{conv} @tab Endian conversion, possible values:
+GFC_CONVERT_NATIVE (0, default), GFC_CONVERT_SWAP (1),
+GFC_CONVERT_BIG (2), GFC_CONVERT_LITTLE (3).
+@end multitable
+
+@item @emph{Example}:
+@smallexample
+int main (int argc, char *argv[])
+@{
+  /* Initialize libgfortran.  */
+  _gfortran_set_args (argc, argv);
+  _gfortran_set_convert (1);
+  return 0;
+@}
+@end smallexample
+@end table
+
+
+@node _gfortran_set_record_marker
+@subsection @code{_gfortran_set_record_marker} --- Set length of record markers
+@fnindex _gfortran_set_record_marker
+@cindex libgfortran initialization, set_record_marker
+
+@table @asis
+@item @emph{Description}:
+@code{_gfortran_set_record_marker} the length of record markers
+for unformatted files.
+
+@item @emph{Syntax}:
+@code{void _gfortran_set_record_marker (int val)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{val} @tab Length of the record marker; valid values
+are 4 and 8. Default is 4.
+@end multitable
+
+@item @emph{Example}:
+@smallexample
+int main (int argc, char *argv[])
+@{
+  /* Initialize libgfortran.  */
+  _gfortran_set_args (argc, argv);
+  _gfortran_set_record_marker (8);
+  return 0;
+@}
+@end smallexample
+@end table
+
+
+@node _gfortran_set_max_subrecord_length
+@subsection @code{_gfortran_set_max_subrecord_length} --- Set length of record markers
+@fnindex _gfortran_set_max_subrecord_length
+@cindex libgfortran initialization, set_record_marker
+
+@table @asis
+@item @emph{Description}:
+@code{_gfortran_set_max_subrecord_length} set the maximum length
+for a subrecord. This option only makes sense for testing and
+debugging of the unformatted I/O.
+
+@item @emph{Syntax}:
+@code{void _gfortran_set_max_subrecord_length (int val)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{val} @tab the maximum length for a subrecord;
+the maximum permitted value is 2147483639, which is also
+the default.
+@end multitable
+
+@item @emph{Example}:
+@smallexample
+int main (int argc, char *argv[])
+@{
+  /* Initialize libgfortran.  */
+  _gfortran_set_args (argc, argv);
+  _gfortran_set_max_subrecord_length (8);
+  return 0;
+@}
+@end smallexample
+@end table
+
+
+
 @c Intrinsic Procedures
 @c ---------------------------------------------------------------------
 
@@ -1913,6 +2428,7 @@
 @item Andy Vaught
 @item Feng Wang
 @item Janus Weil
+@item Daniel Kraft
 @end itemize
 
 The following people have contributed bug reports,
@@ -1925,6 +2441,7 @@
 @item Dominique d'Humi@`eres
 @item Kate Hedstrom
 @item Erik Schnetter
+@item Joost VandeVondele
 @end itemize
 
 Many other individuals have helped debug,
Index: intrinsic.texi
===================================================================
--- intrinsic.texi	(Revision 148016)
+++ intrinsic.texi	(Arbeitskopie)
@@ -11211,7 +11211,13 @@
 @chapter Intrinsic Modules
 @cindex intrinsic Modules
 
-@c @node ISO_FORTRAN_ENV
+@menu
+* ISO_FORTRAN_ENV::
+* ISO_C_BINDING::
+* OpenMP Modules OMP_LIB and OMP_LIB_KINDS::
+@end menu
+
+@node ISO_FORTRAN_ENV
 @section @code{ISO_FORTRAN_ENV}
 @table @asis
 @item @emph{Standard}:
@@ -11251,7 +11257,7 @@
 (@code{*}) in @code{WRITE} statement.
 @end table
 
-@c @node ISO_C_BINDING
+@node ISO_C_BINDING
 @section @code{ISO_C_BINDING}
 @table @asis
 @item @emph{Standard}:
@@ -11273,11 +11279,7 @@
 @c don't really know why.
 
 The @code{ISO_C_BINDING} module provides the following named constants of the
-type integer, which can be used as KIND type parameter. Note that GNU
-Fortran currently does not support the @code{C_INT_FAST...} KIND type
-parameters (marked by an asterisk (@code{*}) in the list below).
-The @code{C_INT_FAST...} parameters have therefore the value @math{-2}
-and cannot be used as KIND type parameter of the @code{INTEGER} type.
+type integer, which can be used as KIND type parameter.
 
 In addition to the integer named constants required by the Fortran 2003 
 standard, GNU Fortran provides as an extension named constants for the 
@@ -11296,17 +11298,17 @@
 @item @code{INTEGER}@tab @code{C_INT16_T}       @tab @code{int16_t}
 @item @code{INTEGER}@tab @code{C_INT32_T}       @tab @code{int32_t}
 @item @code{INTEGER}@tab @code{C_INT64_T}       @tab @code{int64_t}
-@item @code{INTEGER}@tab @code{C_INT128_T}       @tab @code{int128_t}                      @tab Ext.
+@item @code{INTEGER}@tab @code{C_INT128_T}      @tab @code{int128_t}                      @tab Ext.
 @item @code{INTEGER}@tab @code{C_INT_LEAST8_T}  @tab @code{int_least8_t}
 @item @code{INTEGER}@tab @code{C_INT_LEAST16_T} @tab @code{int_least16_t}
 @item @code{INTEGER}@tab @code{C_INT_LEAST32_T} @tab @code{int_least32_t}
 @item @code{INTEGER}@tab @code{C_INT_LEAST64_T} @tab @code{int_least64_t}
-@item @code{INTEGER}@tab @code{C_INT_LEAST128_T} @tab @code{int_least128_t}                @tab Ext.
-@item @code{INTEGER}@tab @code{C_INT_FAST8_T}*  @tab @code{int_fast8_t}
-@item @code{INTEGER}@tab @code{C_INT_FAST16_T}* @tab @code{int_fast16_t}
-@item @code{INTEGER}@tab @code{C_INT_FAST32_T}* @tab @code{int_fast32_t}
-@item @code{INTEGER}@tab @code{C_INT_FAST64_T}* @tab @code{int_fast64_t}
-@item @code{INTEGER}@tab @code{C_INT_FAST128_T}* @tab @code{int_fast128_t}                 @tab Ext.
+@item @code{INTEGER}@tab @code{C_INT_LEAST128_T}@tab @code{int_least128_t}                @tab Ext.
+@item @code{INTEGER}@tab @code{C_INT_FAST8_T}   @tab @code{int_fast8_t}
+@item @code{INTEGER}@tab @code{C_INT_FAST16_T}  @tab @code{int_fast16_t}
+@item @code{INTEGER}@tab @code{C_INT_FAST32_T}  @tab @code{int_fast32_t}
+@item @code{INTEGER}@tab @code{C_INT_FAST64_T}  @tab @code{int_fast64_t}
+@item @code{INTEGER}@tab @code{C_INT_FAST128_T} @tab @code{int_fast128_t}                 @tab Ext.
 @item @code{INTEGER}@tab @code{C_INTMAX_T}      @tab @code{intmax_t}
 @item @code{INTEGER}@tab @code{C_INTPTR_T}      @tab @code{intptr_t}
 @item @code{REAL}   @tab @code{C_FLOAT}         @tab @code{float}
@@ -11334,7 +11336,7 @@
 @item @code{C_VERTICAL_TAB}    @tab vertical tab    @tab @code{'\v'}
 @end multitable
 
-@c @node OpenMP Modules OMP_LIB and OMP_LIB_KINDS
+@node OpenMP Modules OMP_LIB and OMP_LIB_KINDS
 @section OpenMP Modules @code{OMP_LIB} and @code{OMP_LIB_KINDS}
 @table @asis
 @item @emph{Standard}:
Index: libgfortran.h
===================================================================
--- libgfortran.h	(Revision 148016)
+++ libgfortran.h	(Arbeitskopie)
@@ -19,7 +19,9 @@
 
 
 /* Flags to specify which standard/extension contains a feature.
-   Note that no features were obsoleted nor deleted in F2003.  */
+   Note that no features were obsoleted nor deleted in F2003.
+   Please remember to keep those definitions in sync with
+   gfortran.texi.  */
 #define GFC_STD_F2008	(1<<7)	/* New in F2008.  */
 #define GFC_STD_LEGACY	(1<<6)	/* Backward compatibility.  */
 #define GFC_STD_GNU	(1<<5)	/* GNU Fortran extension.  */
Index: iso-c-binding.def
===================================================================
--- iso-c-binding.def	(Revision 148016)
+++ iso-c-binding.def	(Arbeitskopie)
@@ -95,7 +95,8 @@
 NAMED_INTCST (ISOCBINDING_INT_FAST64_T, "c_int_fast64_t", \
               get_int_kind_from_name (INT_FAST64_TYPE), GFC_STD_F2003)
 /* GNU Extension.  */
-NAMED_INTCST (ISOCBINDING_INT_FAST128_T, "c_int_fast128_t", -2, GFC_STD_GNU)
+NAMED_INTCST (ISOCBINDING_INT_FAST128_T, "c_int_fast128_t",
+	      get_int_kind_from_width (128), GFC_STD_GNU)
 
 NAMED_REALCST (ISOCBINDING_FLOAT, "c_float", \
                get_real_kind_from_node (float_type_node))

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]