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

Problem with DO WHILE and /names:as_is

Roenningen__Petter
699 Views
I've encountered a possible bug or issue, which was not a problem in an earlier ifort version (11.1.067), but has surfaced after a software upgrade.
I've been able to reduce the problem to the following, from a rather large and complex software package:
filename: test.for

subroutine test()

do while (.true.)

end do

end subroutine

Compiling this with

ifort test.for /names:as_is

produces the error

test.for(3): error #5082: Syntax error, found '(' when expecting one of: =
do while (.true.)
---------------^
This does not occur when using /names:lowercase or /names:uppercase.
Is this a known bug or issue, or am I overlooking something vital with regards to FORTRAN here?

0 Kudos
1 Solution
Steven_L_Intel1
Employee
699 Views
This is indeed a bug, though you're doing something I strongly recommend against. At first, I thought the issue was that you spelled the constant wrong and it should be .TRUE. But that doesn't work either. This issue with DO WHILE has already been reported, the issue is DPD200156830. The workaround is to write:

DO WHILE (.TRUE.)

That said, you are writing in some language other than Fortran when you use /names:as_is. There are better solutions to whatever problem you tried to solve with that option. Usually that would be an interface block for the non-Fortran routine with either BIND(C,NAME=) or a !DEC$ ATTRIBUTES ALIAS.

View solution in original post

0 Kudos
3 Replies
Steven_L_Intel1
Employee
700 Views
This is indeed a bug, though you're doing something I strongly recommend against. At first, I thought the issue was that you spelled the constant wrong and it should be .TRUE. But that doesn't work either. This issue with DO WHILE has already been reported, the issue is DPD200156830. The workaround is to write:

DO WHILE (.TRUE.)

That said, you are writing in some language other than Fortran when you use /names:as_is. There are better solutions to whatever problem you tried to solve with that option. Usually that would be an interface block for the non-Fortran routine with either BIND(C,NAME=) or a !DEC$ ATTRIBUTES ALIAS.
0 Kudos
Steven_L_Intel1
Employee
699 Views
This has been fixed for a future release.
0 Kudos
Roenningen__Petter
699 Views
Thank you for the reply, Steve. It was most helpful.
Petter
0 Kudos
Reply