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

warn truncated_source generates invalid warning

Dave_Allured
New Contributor II
742 Views
This demo uses fixed source form and a comment indicator to the right of the format statement. The comment extends past column 72.
[bash]
integer ios, state, id, div, name, xlat, xlong, ib, ie, elev read (12, 8, iostat=ios) state,id,div,name,xlat,xlong,ib,ie,elev 8 format(i2,i4,i2,i24,2i8,3i6,2x,a8) ! extended for basin on output end [/bash]
When the compiler option -warn truncated_source is used, Intel fortran generates a warning for this line:
[bash]mac56:~/div/basins 155> ifort -warn truncated_source fixed-format1.f
fixed-format1.f(7): warning #5194: Source line truncated.
 8    format(i2,i4,i2,i24,2i8,3i6,2x,a8)     ! extended for basin on output
------------------------------------------------------------------------^

mac56:~/div/basins 157> ifort -V
Intel Fortran Intel 64 Compiler Professional for applications
  running on Intel 64, Version 11.1    Build 20100806 Package ID:
  m_cprof_p_11.1.089
[/bash]
In my opinion this is an invalid warning because the comment field is clearly initiated before column 73, and comment fields should be exempt from truncation check. IMO the syntax of this example is standard compliant for fixed format. Also from a user perspective, this warning is a nuisance when trying to add comments to fixed format legacy code.
Obviously this is not a critical issue. I would appreciate Intel's opinion and a change in -warn truncated_source if you agree. Thanks for your consideration.
--Dave
0 Kudos
3 Replies
Steven_L_Intel1
Employee
742 Views
This is a long-running argument. We decided to keep it the way it is, partly because doing it otherwise would require moving the check to later in the compilation process and opening the potential for error. If you are sticking to fixed-form source, keep it all to within 72 columns, even the comments.
0 Kudos
Dave_Allured
New Contributor II
742 Views
Hmm. Thanks for the perspective, Steve. Was this discussed in any public forum where I can read the archives?
Meanwhile, I will experiment with -extended-source 132, or constrain my commenting style.
0 Kudos
Steven_L_Intel1
Employee
742 Views
The discussion I know of was internal to the development team. But whichever way we pick, someone will be unhappy. I recommend that you "constrain your commenting style" to conform to the standard, if you must use fixed-form. I have a distaste for coding conventions that require compiler options to make the source valid.
0 Kudos
Reply