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

error #5078: Unrecognized token ' ?' skipped

milenko1976
Beginner
9,269 Views
I have taken one function from press numerical recipees and...
milenko@milenkons:~/pauel$ ifort -c assert_eq.f90
assert_eq.f90(10): error #5078: Unrecognized token ' ?' skipped
write (*,*) nrerror: an assert_eq failed
-------------------^
assert_eq.f90(10): error #5078: Unrecognized token '?' skipped
write (*,*) nrerror: an assert_eq failed
---------------------^
assert_eq.f90(10): error #5078: Unrecognized token '?' skipped
write (*,*) nrerror: an assert_eq failed
----------------------^
assert_eq.f90(10): error #5078: Unrecognized token 'failed?' skipped
write (*,*) nrerror: an assert_eq failed
---------------------------------------------^
assert_eq.f90(10): error #5078: Unrecognized token '?' skipped
write (*,*) nrerror: an assert_eq failed
----------------------------------------------------^
assert_eq.f90(10): error #5078: Unrecognized token '?' skipped
write (*,*) nrerror: an assert_eq failed
-----------------------------------------------------^
assert_eq.f90(10): error #5082: Syntax error, found ':' when expecting one of: , ;
write (*,*) nrerror: an assert_eq failed
------------------------------^
assert_eq.f90(11): error #5078: Unrecognized token ' ?' skipped
STOP program terminated by assert_eq3
------------^
assert_eq.f90(11): error #5078: Unrecognized token '?' skipped
STOP program terminated by assert_eq3

MODULE ASSERT_EQ
CONTAINS
FUNCTION assert_eq3(n1,n2,n3,string)
CHARACTER(LEN=*), INTENT(IN) :: string
INTEGER, INTENT(IN) :: n1,n2,n3
INTEGER :: assert_eq3
if (n1 == n2 .and. n2 == n3) then
assert_eq3=n1
else
write (*,*) nrerror: an assert_eq failed
STOP program terminated by assert_eq3
end if
END FUNCTION assert_eq3
END MODULE
0 Kudos
3 Replies
IanH
Honored Contributor III
9,269 Views
When you copied and pasted the code you brought over a character (a fancy single quote) that isn't in the set of characters that the intel compiler recognises. Have a close look at the single quote character that most of the error messages point to and compare it to the character that appears when you press the single quote key.

You need to replace this fancy quote character (and maybe others) with the quote character that is usually generated when you hit the corresponding key on your keyboard.
0 Kudos
milenko1976
Beginner
9,270 Views
Thanks Ian,I will try it now.
0 Kudos
jimdempseyatthecove
Honored Contributor III
9,270 Views
Ian, Milenko,

In Fortran, derived fromEnglish speaking world,both the single quote ' and single enquote ' are the same character (a vertical looking single upper "dit"). In other languages the single quote ` is a top side left leaning single upper "dit" mark, and single enquote (I don't have it on my keyboard) is a top side right leaning single upper "dit" mark.

If you captured this code using copy and paste through a text editor (which for some languagesnormally uses leaning single quotes) the text editor may have "done you a favor" by converting the quotes for you. In this case, it is not a favor at all.

Jim Dempsey
0 Kudos
Reply