gfortran seems to misreport a warning about exceeding the number of continuation lines limit (39 lines of continuation) in certain cases when compiled with -pedantic.
We found the bug when using a very long write statement, with alternating continuation lines of string literals and data. The bug does not appear if only string literals are used. The bug results in reporting the wrong line as the first invalid continuation line (if there are indeed more than 39) or that there are too many (in the case where there are 39 or fewer). Thanks, Jonathan. Full test case: [EMAIL PROTECTED] ~/bugs/gfortran-4.3/continuation $ gfortran-4.3 -pedantic -o test test.f90 test.f90:23: "Line 15", & 1 Warning: Limit of 39 continuations exceeded in statement at (1) [EMAIL PROTECTED] ~/bugs/gfortran-4.3/continuation $ gfortran-4.3 -v Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ../configure --program-suffix=-4.3 Thread model: posix gcc version 4.3.0 (GCC) [EMAIL PROTECTED] ~/bugs/gfortran-4.3/continuation $ cat test.f90 program test_mod implicit none integer, dimension(50) :: array array = 1 print "(a, i8)", & "Line 1", & array(2), & "Line 3", & array(4), & "Line 5", & array(6), & "Line 7", & array(8), & "Line 9", & array(10), & "Line 11", & array(12), & "Line 13", & array(14), & "Line 15", & array(16), & "Line 17", & array(18), & "Line 19", & array(20), & "Line 21", & array(22), & "Line 23", & array(24), & "Line 25", & array(26), & "Line 27", & array(28), & "Line 29", & array(30), & "Line 31", & array(32), & "Line 33", & array(34), & "Line 35", & array(36), & "Line 37", & array(38), & "Line 39", & array(40), & "Line 41", & array(42), & "Line 43" end program -- Summary: Miscounted continuation lines when interspersed with data Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: J dot Hogg at rl dot ac dot uk GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35882