Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!samsung!munnari.oz.au!uniwa!DIALix!dent From: dent@DIALix.oz.au (Andrew Dent) Newsgroups: comp.lang.fortran Subject: Re: Pseudo-FORTRAN -- f2c for the Macintosh Message-ID: <1017@DIALix.oz.au> Date: 1 Jun 91 10:52:11 GMT References: <1991May30.040829.8696@eplrx7.uucp> Organization: DIALix Services, Perth Western Australia Lines: 36 In <1991May30.040829.8696@eplrx7.uucp> leipold@eplrx7.uucp (Walt Leipold) writes: >I've used f2c, and it works fine -- at least, the generated C code compiles >and runs on a Un*x system. The C code also compiles under Think C on the >Macintosh, but it won't link without f2c's 'standard' libraries, libF77 and >libI77. Can anyone out there who has ported these libraries to the Mac >give me some hints? *Has* anyone used f2c to generate code for the Mac? I >don't want to run f2c on a Mac; I just want to run the C code it generates. I'd be very interested to hear if f2c generates successful code for the Mac as I've spent most of the past 3 months writing a converter from FORTRAN to THINK Pascal. The biggest problem I encountered is the way the Mac stores integers, which causes major problems with arrays of different cell sizes being EQUIVALENCED. eg: INTEGER*2 little(2) INTEGER*4 big EQUIVALENCE (little,big) little(1) = 10 little(2) = 99 on VMS & MS-DOS, big would now have the value 6488074 on Mac: 655459 because the bytes are stored in the opposite order to all FORTRAN implementations. I think that MacFORTRAN has the same problem (without trying to fix it) which means people porting code to the Mac will have a nasty time of it (the stuff I'm translating has algorithms that use overlaid 4 & 2 byte integers all the time, AND the actual binary representations are important:-( BTW - IS there an equivalent of f2c around, for Pascal? Andy Dent A.D. Software phone 09 249 2719 Mac & VAX programmer 94 Bermuda Dve, Ballajura dent@DIALix.oz Western Australia 6066 dent@DIALix.oz.au (international)