Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Token continuation

IanH
Honored Contributor III
1,334 Views
This silly litle example:
[fortran]PROGRAM token_continuation
  IMPLICIT NONE
! Note there's always a blank before the variable name.
  INTEGER&
& this_is_ok        ! "Double-&" continuation
  INTEGER &
and_so_is_this      ! Blank on previous line
  INTEGER&
 but_this_is_not    ! Blank on the continuation line
END PROGRAM token_continuation
[/fortran]
generates this:
[plain]>ifort /check:all /warn:all /stand:f03 /standard-semantics token_continuation.f90
Intel Visual Fortran Compiler XE for applications running on IA-32, Version 12.0.4.196 Build 20110427
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.

token_continuation.f90(9): error #5274: Token incorrectly continued across lines

but_this_is_not ! Blank on the next line
^
...variable not used warnings...
compilation aborted for token_continuation.f90 (code 1)
[/plain]
One for the philosophers - is the third INTEGER token really being continued here?
0 Kudos
2 Replies
Steven_L_Intel1
Employee
1,334 Views
No, it is not - the compiler is wrong. The standard is quite clear on this (emphasis mine):

If a noncharacter context is to be continued, an "&" shall be the last nonblank character on the line, or the last
nonblank character before an "!". There shall be a later line that is not a comment; the statement is continued
on the next such line. If the fi rst nonblank character on that line is an "&", the statement continues at the next
character position following that "&"; otherwise, it continues with the first character position of that line.

I will let the developers know - thanks. Issue ID is DPD200170042.
0 Kudos
Steven_L_Intel1
Employee
1,334 Views

A fix for this is planned for a release later this year. Curiously, if you start the continued line with more than one blank, it's ok.
 

0 Kudos
Reply