Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
27433 Discussions

Using C for comments in column 1 suddenly stopped working

Ken10
Beginner
279 Views

I'm using some legacy code in Visual Studio 2008.  I made a small change and tried to recompile. When I got errors I noticed that the C used in column 1 was being ignored.  I replaced it with ! and I was able to compile.  Also, the editor used to show the continuation column 6 in green which was nice, but that also went away.  

Although I now had the code working, I was puzzled.  I'm using Fixed Form and .for extensions.  After searching around the board I read that some folks said to use .f as an extension.  Tried this and everything went back to "normal".  

I probably have twenty applications all built the same way going back 10+ years and never had this happen before. All use .for extensions.  I recompiled a few of the other applications and didn't have a problem.

Anyone have a suggestion?

0 Kudos
4 Replies
jimdempseyatthecove
Black Belt
261 Views

Look at the command line options (or in MS VS property page) for the option that specifies to compile as Fixed Format and add that to the Project Property.

Jim Dempsey

Ken10
Beginner
256 Views

Jim - I saw that as an option while researching, but got it fixed with renaming the extension. It is simply strange that suddenly this application or something in VS suddenly went whacky. I went so far as to pull an old copy from backup, and it looked fine until I compiled then it did the same thing.  Although, I have used versions of VS for 20 years I know just enough to be dangerous.  Thanks.  

andrew_4619
Honored Contributor II
250 Views

You may have a broken Fortran install for the VS Fortran integrations. An install / repair of Fortran might help.

 

Ken10
Beginner
195 Views

Thanks to everyone who replied.  I have been using Intel FORTRAN for many years.  This was my first time posting, and I really appreciate the help.  

Reply