Array boundary checking & Fortran <> C translators

Michael L. Takayama tak at aerospace.aero.org
Tue Feb 6 04:38:04 AEST 1990


Thanks for the reminder... guess that it is time to re-read the ol'
K&R!

Verification, please - automatic conversion of float to double occurs
in the parameter declaration of a function in C.  When calling a
Fortran routine from C, this conversion does *not* occur, i.e. a float
passed from C to Fortran should be correctly interpreted as a REAL?

Example:

subtestc()
{
    float a;
   
    a = 1234.5678;
    subtestf_(&a);
}

      SUBROUTINE SUBTESTF(A)
      REAL A

      WRITE(*,*) A

      RETURN
      END


Thanks again (wish you guys were on the Hotline!) -

Michael L. Takayama
Computer-Aided Engineering Department
The Aerospace Corporation



More information about the Comp.sys.sgi mailing list