Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!uxc!uxc.cso.uiuc.edu!uxg.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.fortran Subject: Re: Fortran graphics Message-ID: <50500104@uxe.cso.uiuc.edu> Date: 11 Feb 89 16:00:00 GMT References: <4328@hubcap.UUCP> Lines: 34 Nf-ID: #R:hubcap.UUCP:4328:uxe.cso.uiuc.edu:50500104:000:1658 Nf-From: uxe.cso.uiuc.edu!mcdonald Feb 11 10:00:00 1989 >If and only >if a comiler claims to produse object code compatible with that of >another compiler should you attempt to link the two. Even then, as I >said before, you usually must use a restricted subset of both languages. Not entirely true. I have used assembly glue routines to link Microsoft C and RyanMcFarland Fortran - and they use violently different calling conventions. The restricted part is true: you have to be sure that EITHER the run-time io systems are compatible, OR make sure that one doesn't get loaded. With the Microsoft languages, there are relatively easy ways to do this: compile with /Fa /Oil /Gs to get rid of as many calls as possible (remove stack check calls and use inline subroutines where possible) and generate assembly output. Then edit the .asm files to remove things like the __acrtused global. A MSC program done that way, with NO floating arithmetic, and using no IO, only harmless calls like strcpy, etc, will be pretty generically useable. Floating point is easy too, if you have an '87: use /FPi87 AND, and this is bizarre in the extreme, make a dummy assembler routine containing all those weird FISRQQ-like globals that appear in a link map you get if you link without any run-time modules. That is, make variables with those names and make them public, then assemble it and link with your files. (Microsoft languages with /FPi87 generate actual '87 calls in their .obj modules. BUT, unless you do this bizarre thing, Microsoft's LINKER REMOVES THOSE INSTRUCTIONS AND REPLACES THEM WITH SOFTWARE INTERRUPTS.) If they would document things better, it would be easier to do links like this. Doug McDonald