format interpreter - bug ?

Luca Bottura Luca.Bottura@cern.ch
Wed Apr 14 06:53:00 GMT 1999


I have isolated the following anomalous response to egcs to an error in
the specification of an implicit format. The program:

      real a(20)

      do i=1,20
         a(i) = 1
      enddo
      write(6,'(10((1x,1p,e11.3))') (a(i),i=1,20)

      stop
      end

compiles and links in spite of the wrong number of parentheses in the
format (three openj parentheses, two closed parentheses). At runtime the
executable crashes (as expected)  with the error:

startio: error in format
apparent state: (10((1x,1p,e11.3))
lately writing sequential formatted external IO
Aborted (core dumped)

Why is the format error not caught before (at compilation) ?

I am running egcs - 1.0.2 prerelease on MkLinux DR3.0 (calling egcs
--version results in the output of egsc - 2.90.25 980302 egcs - 1.0.2
prerelease).

tqvm, Luca






More information about the Gcc-bugs mailing list