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

Using C for comments in column 1 suddenly stopped working

Ken10
Beginner
634 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
Honored Contributor III
616 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

0 Kudos
Ken10
Beginner
611 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.  

0 Kudos
andrew_4619
Honored Contributor II
605 Views

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

 

0 Kudos
Ken10
Beginner
550 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.  

0 Kudos
Reply