- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Fortran Enthusiasts!
I want to compile a file using the FPP. The file contains a compiler directive. This is what happens:
If I type: fpp preproc1.for preproc1.i the intermediate file is generated correctly. However, if I type ifort /fpp /Qsave-temps preproc1.for, the intermediate file is truncated in the free form section. The same happens when I compile through the Visual Studio 2005.
What can I do to make this work through VS2005?
I attached a zip file containg the example. I have VS 2005 Standard and IVF 10.0.011.
Thank you for your time,
Daniel I.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On the other hand, this illustrates an ongoing gripe I have had with our fpp in that it effectively "lexes" (separates out tokens and keywords) the Fortran statement and reassembles it, rather than doing a strict line-by-line replacement. Most of the time this is not noticeable. One might argue that if it's going to do this then it ought to honor directives that change how lexing works. I'll bring this to the attention of the developers.
Still, my advice would be "don't do that". My general advice is to not use fixed-form at all, but if you must, do not play tricks with !DEC$ FREEFORM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Thank you for answering so quickly and for raising this with the developers.
I have just the right example that shows the lexing in action.
Original code (all freeform):
write(message,fmt="(a)")"This should be &
only one line"
PreProcessed:
write(message,fmt="(a)")"This should be only one line"
So basically, the leading blanks are inserted into the message.
Granted this is bad coding. The better version is:
write(message,fmt="(a)")"This should be " // &
"only one line"
Thank you for your help Steve!
Daniel I.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
write(message,fmt="(a)")"This should be &
&only one line"

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page