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

Truncated source line warnings

ereisch
New Contributor II
587 Views

Revisiting an old topic, would it be possible to add a slightly different option to the "truncated_source" -warn flag that ignores comment fields?  We encourage our developers to heavily comment their code, but with "-warn truncated_source" set, there are a lot of false positives when comments that start with the "!" symbol run past 132 columns.

Thanks for considering.

0 Kudos
3 Replies
Steve_Lionel
Honored Contributor III
587 Views

May I suggest instead that you encourage your developers to use free-form source? You wouldn't have this issue, then. New code should never be developed using fixed-form - it encourages errors.

0 Kudos
FortranFan
Honored Contributor II
587 Views

Steve Lionel (Ret.) (Blackbelt) wrote:

May I suggest instead that you encourage your developers to use free-form source? You wouldn't have this issue, then. New code should never be developed using fixed-form - it encourages errors.

Nothing to do with free-form source

! Long comment line -----------------------------------------------------------------------------------------------------------------
end
C:\Temp>type p.f90
! Long comment line -----------------------------------------------------------------------------------------------------------------
end

C:\Temp>ifort /c /warn:all /stand p.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.0.085 Pre-Release Beta Build 20190522
Copyright (C) 1985-2019 Intel Corporation.  All rights reserved.

p.f90(1): warning #5268: Extension to standard: The text exceeds right hand column allowed on the line.
! Long comment line -----------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------^

C:\Temp>

 

0 Kudos
Steve_Lionel
Honored Contributor III
587 Views

That's only if you ask for standards checking - very different from -warn truncated_source (as mentioned in the OP) which applies only to fixed-form.

Of course, even 132 is non-standard for fixed-form.

0 Kudos
Reply