Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!jato!vsnyder From: vsnyder@jato.jpl.nasa.gov (Van Snyder) Newsgroups: comp.lang.fortran Subject: Re: Pseudo-FORTRAN -- f2c for the Macintosh Message-ID: <1991Jun3.170858.23956@jato.jpl.nasa.gov> Date: 3 Jun 91 17:08:58 GMT References: <1991May30.040829.8696@eplrx7.uucp> <1017@DIALix.oz.au> Reply-To: vsnyder@jato.Jpl.Nasa.Gov (Van Snyder) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 37 In article <1017@DIALix.oz.au> dent@DIALix.oz.au (Andrew Dent) writes: >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:-( > For doing such a thing, you deserve what happens to you. -- vsnyder@jato.Jpl.Nasa.Gov ames!elroy!jato!vsnyder vsnyder@jato.uucp