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

error #5120: Unterminated character constant

raulepuebla
Beginner
6,827 Views
I tryied to compile a BIG code and I go the following errors:

error #5120: Unterminated character constant

error #5082: Syntax error, found END-OF-STATEMENT when expecting one of:

error #7589: Not a valid value for the char-expr in this connect-spec.


I suspect that it is about line extensions. Previously I compiled the same code with the 10.1 version of the compiler, but I am using the 12.0 version and get that error.

Somebody could help me with some flags or something that could solve that problem?

Thanks!!!

Raul


0 Kudos
6 Replies
mecej4
Honored Contributor III
6,827 Views
Somebody could help me with some flags or something that could solve that problem?

Unlikely, since you have not shown us a single line of your source code, nor have you divulged the old and new file names.
0 Kudos
Ron_Green
Moderator
6,827 Views
sounds like you have a fixed-format source file and you forgot to use -extend-source 132 or -extend-source 80
0 Kudos
raulepuebla
Beginner
6,827 Views
Hi Ronald,

These are the flags I am using

ifort -c -extend-source 132 -O2 -g -nbs

I also tried extend-source 80 but it didnt work. The code line that shows the problem has not anything special:

OPEN(UNIT=LUIN,FILE='REVISED_LAMBDAS',STATUS='OLD',IOSTAT=IOS,ACTION='READ')

The code files are all .f, I couldnt change the file names to every files because of they are so many.

Thanks

0 Kudos
Ron_Green
Moderator
6,827 Views
The error messages indicate that the compiler thinks that one of the character constants is unterminated. Sometimes this happens if there is a back quote instead of a quote OR the file was corrupted during a transfer of the file from one system to another, like coming from a Windows system to a linux system.
I would re-write that statement by hand on a new line below this line. I'd use spaces instead of the tab, and be careful to use single-quotes OR you could try double quotes. When you have re-typed the line, delete the old line and see what happens.
ron
0 Kudos
raulepuebla
Beginner
6,827 Views
Hi Roland,

Thanks for your help. I done it, but the problem persists.

Thanks
0 Kudos
Ron_Green
Moderator
6,827 Views
I'd have to look at the code. My next guess is that you have an unterminated quote in the lines above this line. Have you brought the code into an editor that highlights syntax, like vim or emacs? The colored syntax highlighting might help you find the problem.

OR Can you attach the .f file and any modules (if any) that is USEs ?

Here's how to attach files: http://software.intel.com/en-us/articles/how-to-attach-file-insert-code-into-forum-post/
0 Kudos
Reply