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

Bug regarding warnings about line truncation


I am working on a fixed format Fortran legacy program and found a bug regarding the warnings about line truncation.

If you compile the following program using:

ifort  -warn all,error source_truncation.f

      program source_truncation                                                 
      integer :: i                                                              
* This comment exceed column 72 and does not lead to an error.  pewpepepwwepwepwe
      ! This comment exceeds column 72 and does lead to an error.  pewpepepwwepwe
      i = 1 + 2                                                                 
      write(*, *) i                                                             
      end program           

you will get an error only for the second comment.

It is a bit inconsistent, that a comment, as defined by a character in the first column, and a comment, as defined by exclamation marks, are treated differently.


The tested compilers are:

ifort (IFORT) 18.0.1 20171018

ifort (IFORT) 16.0.1 20151021

0 Kudos
0 Replies