From: muzic@ds2.uh.cwru.edu (Ray Muzic)
Subject: fortran + c application linker bug???
Date: 8 Aug 94 17:00:35 GMT [thread overview]
Message-ID: <muzic.776365235@ds2.uh.cwru.edu> (raw)
I am customizing a public domain code which is mainly fortran (program +
approx 300 subroutines and functions) but has a collection of c routines
that do plotting via xwindows. The fortran code defines a function screen
and the c code defines an int screen. When I build this application I get
an access violation when the c routine tries to assign the value zero to
screen. This makes sense because according to the debugger,
screen is considered top be a function. Moreover, when I changed the
name screen to rscreen in the c code, the program works fine.
My questions are these:
1) Is this a bug? Should c and fortan keep their own copies of screen?
1) Why does this program work correctly on other (Unix) platforms? Is it
because some platforms append underscores, capitalize, or otherwise
modify variable names of fortran variables?
2) Is there a way to link things differently to solve this problem for VMS?
Particulars
OpenVMS AXP (TM) Operating System, Version V1.5-1H1
DEC Fortran V6.1-386
DEC C V1.3-000A
c code fragment
int border_width=10, ch_flag, ch_old, ch_pixel, color_flag,
cursor_shape[]={XC_cross, XC_top_left_corner,
XC_bottom_right_corner}, depth, display_height,
display_height_mm, display_width, display_width_mm, height,
pnt_x, pnt_y, res_x, res_y, screen, width, win_flag, win_shape,
xo=0, yo=0;
fortran code fragment
The fortran code is compiled fortran/separate/nooptimize, the c code is compiled
cc/nooptimize, and the pieces are linked together fortran first, c second, options file,
vaxcrtl/library.
function screen(ar)
Line of c-code that causes access violation (DefaultScreen is the standard x macro).
screen=DefaultScreen(display);
Ray Muzic
--
* Ray Muzic, Jr., Ph.D. | "I try not to think, it slows the progress." - rfm2 *
* muzic@ds2.uh.cwru.edu | Biomedical Engr, CWRU & Image Analysis Ctr, UH __o *
* Voice: (216)-844-3543 | Div. Nuclear Medicine, Univ Hosp of Cleveland -\<, *
* Fax: (216)-844-3106 | 11100 Euclid Ave, Cleveland, OH, 44106, USA....O/ O *
next reply other threads:[~1994-08-08 17:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-08-08 17:00 Ray Muzic [this message]
1994-08-10 14:49 ` fortran + c application linker bug??? Dan Pop
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox