From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,251f6aad76e3546e X-Google-Attributes: gid1164f8,public From: Dan.Pop@mail.cern.ch (Dan Pop) Subject: Re: f77/cpp bug? Date: 1995/08/10 Message-ID: #1/1 X-Deja-AN: 107832219 sender: news@news.cern.ch (USENET News System) x-nntp-posting-host: ues5.cern.ch references: <409n4u$3j4@cortaro.math.arizona.edu> organization: CERN European Lab for Particle Physics newsgroups: comp.sys.dec In <409n4u$3j4@cortaro.math.arizona.edu> hays@math.arizona.edu (Mark Hays) writes: >I think I may have found a bug in the DEC f77 compiler. > >>From the f77(1) manpage: > "Arguments with the suffix .F are interpreted as FORTRAN source pro- > grams which must be processed by the C preprocessor (cpp(1)) before > being compiled." > >>From the cpp(1) manpage: > "The cpp preprocessor accepts C++-style end of line comments (//). This > means that everything following the two slashes (//) to the end of the line > in which they appear is considered as a comment." > >Since there doesn't seem to be a way to turn off the >removal of C++ comments, may I assume that one should >never concatenate strings (with //) in DEC f77 .F >files? Have you actually tried to compile a .F file which contains // with f77 and had problems? I have only f90 installed and I never had this problem because the compiler does the right thing: it invokes cpp with whatever magic options are required to disable the C++ comments: ues5:~/tmp 499> cat foo.F print *, "foo" // "bar" end ues5:~/tmp 500> f90 foo.F ues5:~/tmp 501> ./a.out foobar I complained to DEC about the (broken, IMHO) _default_ behaviour of cpp WRT C++ style comments (it breaks utilities like xrdb if you have URL's in your .Xdefaults), but their answer was: Here is the feedback we received from Engineering concerning the "cpp" behaviour which makes you feel unhappy. After careful reflection, they decided to leave the "C++ comment style" functionnality of "cpp" unchanged. Dan -- Dan Pop CERN, CN Division Email: Dan.Pop@mail.cern.ch Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland