- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.f90One for the philosophers - is the third INTEGER token really being continued here?
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]
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 first 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.
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 first 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page