File: fun_f.f

package info (click to toggle)
cfortran 20210827-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 756 kB
  • sloc: ansic: 3,302; fortran: 959; makefile: 113; sh: 14
file content (27 lines) | stat: -rw-r--r-- 947 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
C /* fun_f.f */                  /* anonymous ftp@zebra.desy.de */
C /* An example from cfortran.h package. Requires fun.c         */
C /* Burkhard Burow  burow@desy.de                 1990 - 1996. */

      integer function fadd(a,b)
      implicit none
      integer a,b
      fadd = a + b
      return
      end

      integer function funadd(fun,a,b)
      implicit none
      external fun
      integer a,b,fun
C WARNING FOR Alpha/OSF!
C The DEC Fortran and the DEC C compilers of DEC OSF/1 [RT] V1.2 (Rev. 10)
C will crash on this example as it stands.
C See cfortran.doc for a cleaner example of this misbehavior.
C Note that the routine funarg below, whose argument f is also an integer
C function, does not have this problem.
C This example will work if an extra argument is given to function 'fun'.
C i.e. For Alpha/OSF replace the following line with the kludge:
C     funadd = fun(a,b,1)
      funadd = fun(a,b)
      return
      end