Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!unmvax!ariel.unm.edu!ghostwheel.unm.edu!john From: john@ghostwheel.unm.edu (John Prentice) Newsgroups: comp.lang.fortran Subject: Re: Fortran vs. C for numerical work (SUMMARY) Message-ID: <1990Dec5.183112.2928@ariel.unm.edu> Date: 5 Dec 90 18:31:12 GMT References: <1990Dec4.011220.9302@ccu.umanitoba.ca> <26434:Dec404:42:4990@kramden.acf.nyu.edu> <1990Dec4.190148.4026@ariel.unm.edu> <2642@charon.cwi.nl> Sender: John K. Prentice Organization: University of New Mexico Math Dept., Albuquerque, NM Lines: 32 In article <2642@charon.cwi.nl> dik@cwi.nl (Dik T. Winter) writes: >... Everything goes through the C preprocessor >because of machine pecularities (as some parts are written in assembler this >is necessary). However, the C preprocessor is also used to avoid compiler >bugs. and after some more comments ... >3. Especially if you have a large body of code, be prepared to customize it > to every platform you may encounter. Allow the use of preprocessors to > do this (C preprocessor, m4, your own special built macro processor, etc.). > For what it is worth, I would second this suggestion. We used to use a home grown preprocessor called SAIL which we wrote back in 1972 before such things were generally available. Now we use the C preprocessor for this (the C preprocessor is pretty limited in capabilities, but it is usually sufficient. The big problem with the C preprocessor is that damn near every one I have used is a little different! For example, the one that Borland sends out with their Turbo C and Turbo C++ will left justify every line of the processed code (dumb!). The Decus C preprocessor issued by the C User's Group does the same thing. Then you find that the Cray C preprocessor can't handle all the preprocessor constructs listed in version 2 of K&R (i.e., the ANSI version). The Sun versions seem to pretty much work okay. All this can be a real pain in using the C preprocessor however unless you limit yourself to really simple uses). We have not had to use the C preprocessor to handle bugs however, so far we use it mostly to separate machine dependent code (for example, array constructs for the CM2 versus loops on every other computer). John Prentice john@unmfys.unm.edu Brought to you by Super Global Mega Corp .com