Xref: utzoo comp.lang.fortran:4790 comp.unix.cray:249 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!rex!uflorida!ufqtp!bernhold From: bernhold@qtp.ufl.edu (David E. Bernholdt) Newsgroups: comp.lang.fortran,comp.unix.cray Subject: CPP "problems" (was Re: why has Cray dropped CPP support from cf77?) Message-ID: <1300@red8.qtp.ufl.edu> Date: 18 Feb 91 18:11:00 GMT References: <1298@red8.qtp.ufl.edu> <1991Feb18.145116.3840@convex.com> Organization: Quantum Theory Project, Univ. of Florida Lines: 40 I don't want to start another thread (war?) on preprocessors, but I had to respond to Patrick's remarks... In article <1991Feb18.145116.3840@convex.com> patrick@convex.COM (Patrick F. McGehearty) writes: >... I do know that >while using cpp works as a preprocessor for many programs, it also >has weaknesses since the tokenizing rules for fortran and C are so >different. ... It is worth noting that this difference in blank significance is only relevant when using the macro substitution capabilities of CPP -- the include and conditional compilation features are all given with lines beginning '#' as their first non-blank character. The only possible confusion is if someone uses '#' as a continuation indicator, and since '#' isn't in the f77 character set, its as non-standard as using CPP. If one is aware of the capabilities & limitations of CPP, it can be a very useful tool. I don't council using _any_ tool without a pretty good understanding of what it is (supposed) to do and how. >A blanket decision to run CPP over large "dusty-deck" unstructured Fortran >programs can reach up and bite you without giving any indication of what >happened. Use with caution! This is probably also true of many other preprocassors people use with Fortran source. If they interpret (for example) comment lines in a certain format as preprocessor instructions, you may find a bad interaction with comments in the dusty-deck that _happen_ to have that format. Same result. Also note that most CPP implementations allow you to remove the definitions of all macros defined by default -- useful if problems do occur. -- David Bernholdt bernhold@qtp.ufl.edu Quantum Theory Project bernhold@ufpine.bitnet University of Florida Gainesville, FL 32611 904/392 6365