C porting problem, CURSES, Vax MACRO

Christopher Chiesa cfchiesa at bsu-cs.UUCP
Mon Oct 3 08:39:29 AEST 1988


Greetings.

I suspect the following may be covered in the Vax C manuals but, unfortunately,
my access to such is presently "chancy" at best.  Forgive me for asking a pos-
sibly stupid or beaten-to-death question, but I've pretty well exhausted all 
other sources and the Net has done me well in the past.

My question is this:  

  I'm helping a friend port a C program from this 4.3 BSD UNIX system, to VMS 
4.7.  Okay, okay, when you quit laughing, read on... ;-)  There wouldn't be
any problem EXCEPT that this particular program uses CURSES, which exists on
our UNIX system with no problems, but the VMS version of which I'm told is 
"buggy." 

  We are having a certain amount of difficulty resolving certain CURSES library
function references.  VMS appears to have its own version of CURSES, but some of
the functions this program uses are named differently and others are just plain
absent.

  This in itself isn't an insurmountable obstacle.  We've been doing pretty
well by comparing UNIX 'man' pages (to find out what the missing or renamed 
routines are supposed to DO) against VMS HELP files (to find routines of equiv-
alent functionality on VMS), but some things are still just NOT THERE.  

  In those few cases, I thought we could solve the problem by writing our own
MACRO functions, named the same, and performing the same functions, as the mis-
sing routines, and link them into the existing C program to resolve the ref-
erences.  However, after having the program successfully compile and link, and
them bomb spectacularly on execution with an "opcode reserved to Digital" mes-
sage and register dump, I started to worry.

  I recompiled, reassembled, and relinked with DEBUG, and found that there are
NO symbols for the names of my replacement routines in the .EXE image, and that
when the CALLS instruction arrives which ought to go out and invoke my routine,
execution instead attempts to proceed in an area of memory filled with HALT
instructions, and no sign of my routine anywhere in the vicinity.  

  At risk of violating the dictum against stating "what you think the problem
is," it LOOKS like Vax C is somehow not "making nice" with routines written in
other languages, i.e. the basic "compatibility" promised by the "standard"
Vax/VMS Procedure (and function) Calling Standard.  I, however, am a very new
C user and have noted that there are so many points of deviation between what
goes into other Vax language compilation-and-linking, and what goes into the
Vax C equivalent, that I am fully aware that I may well be missing something 
significant.

  If anyone on the Net can tell me, in general, or in step-by-step instructions,
or by pointer to manuals (cross fingers, I may be able to locate one yet!), how
to get Vax C and Vax MACRO to "make nice," I'd appreciate it immensely both now
and on future projects.  I seem to remember methods of generating MACRO routine
addresses other than the .ENTRY directive I'm using, if that jogs anyone's 
memory and might be relevant.  Thanks in advance for ANY help ANYONE can 
provide.

  One request: comp.os.vms respondents may post OR e-mail responses; comp.lang.c
respondents please DEFINITELY e-mail as I am not (yet) a regular reader of the
group.  Thanks.

  Chris Chiesa
    Ball State University, Muncie, IN, USA 
-- 
UUCP: <backbones>!{iuvax,pur-ee,uunet}!bsu-cs!cfchiesa 
cfchiesa at bsu-cs.UUCP                                           



More information about the Comp.lang.c mailing list