egcs-1.1.1: g77: line numbers in diagnostic messages

wefing@kato.pci.uni-heidelberg.de wefing@kato.pci.uni-heidelberg.de
Mon Dec 14 09:03:00 GMT 1998


hi folks,

g77 outputs wrong line numbers in the presence of nested `INCLUDE' statements.
consider the following 3 files:

power.f    -----------------------------------------------------------------
      program power
      include 'file1.inc'
      real*8 x,y
      integer i

      write(6,*) 'n?'
      read(5,*) n

      y=0.999
      do i=1,n
         x=y**2.1d0

      stop
      end
file1.inc -----------------------------------------------------------------
C
C
C
      integer dummy1
      real    dummy2
      include 'file2.inc'
file2.inc -----------------------------------------------------------------
      integer i10
      real r10
      complex c10
---------------------------------------------------------------------------

in power.f, the enddo statement is missing. g77 issues the following
diagnostics:

wefing/ftest> g77 -O -o power power.f
power.f: In program `power':
power.f:14:
         do i=1,n
         1
power.f:18: (continued):
         end
         2
Statement at (2) invalid in context established by statement at (1)
power.f:14:
         do i=1,n
         ^
End of source file before end of block started at (^)
Exit 1

in contrast to this message, the do statement is at line 10 of power.f.
if i comment out >include 'file2.inc'< in file1.inc, the line numbers are
correct, i.e., a simple first level inclusion works. also, if i use the cpp
directive "#include" instead, line numbers are correct even for nested
inclusions.

best regards, stephan wefing

+-------------------------------------------------------------------+
|  Stephan Wefing                                                   |
|  Theoretische Chemie                                              |
|  Universitaet Heidelberg                                          |
|  Im Neuenheimer Feld 253                                          |
|  D-69120 Heidelberg                                               |
+-------------------------------------------------------------------+
|  e-mail: wefing@gmx.de         |  Tel. :  +49 +6221 548515        |
|  Fax   :  +49 +6221 54 5221    |  Tel. :  +49 +6221 435947        |
+-------------------------------------------------------------------+


i'm using a PII machine with suse linux 5.3, kernel 2.0.35.

wefing/ftest> g77 -v
g77 version egcs-2.91.60 19981201 (egcs-1.1.1 release) (from FSF-g77 version
0.5
.24-19980804)
Driving: g77 -v -c -xf77-version /dev/null -xnone
Reading specs from
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.
60/specs
gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
 /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.60/cpp -lang-c
-v
-undef -D__GNUC__=2 -D__GNUC_MINOR__=91 -D__ELF__ -D__unix__ -D__i386__
-D__i386
__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(posix) -D_LANGUAGE_FORTRAN
-
traditional -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386
-D__i386_
_ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__
/dev/n
ull /dev/null
GNU CPP version egcs-2.91.60 19981201 (egcs-1.1.1 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/egcs/i686-pc-linux-gnulibc1/include
 /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.60/include
 /usr/include
End of search list.
 /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.60/f771
-fnull-ver
sion -quiet -dumpbase g77-version.f -version -fversion -o /tmp/ccgqgKBr.s
/dev/n
ull
GNU F77 version egcs-2.91.60 19981201 (egcs-1.1.1 release)
(i686-pc-linux-gnulib
c1) compiled by GNU C version egcs-2.91.60 19981201 (egcs-1.1.1 release).
GNU Fortran Front End version 0.5.24-19980804
 as -V -Qy -o /tmp/ccquLamJ.o /tmp/ccgqgKBr.s
GNU assembler version 2.9.1 (i486-linux), using BFD version 2.9.1.0.4
 ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.1 -o /tmp/ccuHG1K3
/tmp/ccquLam
J.o /usr/lib/crt1.o /usr/lib/crti.o
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gn
ulibc1/egcs-2.91.60/crtbegin.o
-L/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnuli
bc1/egcs-2.91.60 -L/usr/local/egcs/i686-pc-linux-gnulibc1/lib
-L/usr/local/egcs/
lib -lg2c -lm -lgcc -lc -lgcc
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1
/egcs-2.91.60/crtend.o /usr/lib/crtn.o
 /tmp/ccuHG1K3
__G77_LIBF77_VERSION__: 0.5.24
@(#)LIBF77 VERSION 19970919
__G77_LIBI77_VERSION__: 0.5.24-19980920
@(#) LIBI77 VERSION pjw,dmg-mods 19980617
__G77_LIBU77_VERSION__: 0.5.24
@(#) LIBU77 VERSION 19980709



More information about the Gcc-bugs mailing list