Vax C90-EL SERIES Service Manual Page 146

  • Download
  • Add to my manuals
  • Print
  • Page
    / 216
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 145
Cray Standard C/C++ Reference Manual
9.3 Calling Fortran Functions and Subroutines from a C or C++ Function
This subsection describes the following aspects of calling Fortran from C or
C++. Topics include requirements and guidelines, argument passing, array
storage, logical and character data, accessing named common, and accessing
blank common.
9.3.1 Requirements
Keep the following points in mind when calling Fortran functions from C or C++:
Fortran uses the call-by-address convention. C and C++ use the call-by-value
convention, which means that only pointers should be passed to Fortran
subprograms. See Section 9.3.2, page 127.
Fortran arrays are in column-major order. C and C++ arrays are in row-major
order. This indicates which dimension is indicated by the first value in an
array element subscript. See Section 9.3.3, page 127.
Single-dimension arrays of signed 64-bit integers and single dimension arrays
of 64-bit floating-point numbers are the only aggregates that can be passed as
parameters without changing the arrays.
Fortran character pointers and character pointers from Cray Standard C/C++
are incompatible. See Section 9.3.4, page 128.
Fortran logical values and the Boolean values from C and C++ are not fully
compatible. See Section 9.3.4, page 128.
External C and C++ variables are stored in common blocks of the same
name, making them readily accessible from Fortran programs if the C or
C++ variable is in uppercase.
When declaring Fortran functions or objects in C or C++, the name must be
specified in all uppercase letters, digits, or underscore characters and consist
of 31 or fewer characters.
In Cray Standard C, Fortran functions can be declared using the fortran
keyword (see Section 5.2, page 106). The fortran keyword is not available
in Cray Standard C++. Instead, Fortran functions must be declared by
specifying extern "C".
126 S217936
Page view 145
1 2 ... 141 142 143 144 145 146 147 148 149 150 151 ... 215 216

Comments to this Manuals

No comments