This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Fortran 77 pointers
- To: gsl-discuss at sourceware dot cygnus dot com
- Subject: Fortran 77 pointers
- From: "E. Robert Tisdale" <edwin at netwood dot net>
- Date: Mon, 17 Jul 2000 04:11:16 +0000
c $ uname -m -r -s -v
c Linux 2.0.36 #1 Tue Oct 13 22:17:11 EDT 1998 i686
c $ g77 --version
c egcs-2.90.29 980515 (egcs-1.0.3 release)
c $ g77 -O2 -fno-globals -o gsl_pointer gsl_pointer.F gsl_address__.o
c
c gsl_pointer.F
#define gsl_double double precision
#define gsl_pointer integer
#define gsl_storage character
c
subroutine f(x)
gsl_double x
write(*,*) x
end
c
subroutine g(p)
gsl_pointer p
gsl_storage gsl_memory_start(1)
common /gsl_memory_space/gsl_memory_start
gsl_pointer gsl_address
gsl_pointer q
q = 1 + p - gsl_address(gsl_memory_start)
call f(gsl_memory_start(q))
end
c
program main
gsl_storage gsl_memory_start(1)
common /gsl_memory_space/gsl_memory_start
gsl_pointer gsl_address
gsl_double x
x = 36.0
call g(gsl_address(x))
end
c
c /* gsl_address__.c */
c typedef int gsl_pointer;
c typedef char gsl_storage;
c
c gsl_pointer gsl_address__(gsl_storage* ps) {
c return (gsl_pointer)ps;
c }