VAX VMS C / UNIX C Compatibility -- Need Info

rdp at teddy.UUCP rdp at teddy.UUCP
Fri Aug 9 00:56:17 AEST 1985


In article <488 at rdin.UUCP> perl at rdin.UUCP (Robert Perlberg) writes:
>Is the VAX VMS C-compiler compatible with UNIX?  That is, can I take
>C files that compiled under UNIX and compile them under VMS with no
>changes other than the shell commands inside of system() calls? A guy
>in my office says that to hope for this is naive at best, but I thought
>that this ability was supposed to be a feature of C.
>
>Another thing I'm looking for under VMS is the ability to load both
>C and FORTRAN object files into one executable. Does anyone know if
>this works?
>

When I was working for Applicon, I convinced people to get the Decus C
compiler in house. Previous to that, the standard language was a severely
bastardized PL/I (bletch!). My experiences follow:

With the exception of some RMS-specific stuff (needed to gbet around the
insistance of the stdio routines to do things exactly like unix) I was able
to code my applications using direction from UNIX documentation. Seldom,
if ever, did I refer to the VMS C documentation for specific features or
bugs. I was able to port one RATFOR compiler over to VMS (it did not use
YACC or LEX) with no source changes at all. What changes I made were to
support VMS DCL argument style. It was pretty simple.

I also had the occasion to interface quite a bit to FORTRAN and PL/I
routines from C, and vice versa. This was very, very simple. The only
thing you have to remember is that FORTRAN expects call by reference, whereas
C passes by value. This was solved by calling fortran routines from C and
passing pointers to all arguments. If you need to call a C library routine
from FORTRAN, and need to pass by value, the VMS "%VAL" descriptor works
fine. 

All in all, I went through the same situation as yours with very little
trouble. I did not use very UNIX dependent routines, and that helped a
lot. I might even venture to say, knowing I will be severely flamed for it,
that developing UNIX apllications is much easier under VMS than UNIX. But
I know better than to tilt at sacred windmills.



More information about the Comp.lang.c mailing list