Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/3/84; site teddy.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!harvard!talcott!panda!teddy!rdp From: rdp@teddy.UUCP Newsgroups: net.lang.c,net.lang.f77 Subject: Re: VAX VMS C / UNIX C Compatibility -- Need Info Message-ID: <1116@teddy.UUCP> Date: Thu, 8-Aug-85 10:56:17 EDT Article-I.D.: teddy.1116 Posted: Thu Aug 8 10:56:17 1985 Date-Received: Sun, 11-Aug-85 04:24:29 EDT References: <488@rdin.UUCP> Reply-To: rdp@teddy.UUCP (Richard D. Pierce) Organization: GenRad, Inc., Concord, Mass. Lines: 37 Xref: linus net.lang.c:5419 net.lang.f77:299 In article <488@rdin.UUCP> perl@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.