This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: walking a namespace to check a symbol name?
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Cc: fortran at gcc dot gnu dot org
- Date: Mon, 02 May 2005 00:56:35 +0200
- Subject: Re: walking a namespace to check a symbol name?
- References: <20050501180715.GA65460@troutmask.apl.washington.edu>
Steve Kargl wrote:
> How does one walk a namespace to determine if a name
> has previous been used? The following program is
> illegal (see PR 21257)
>
> program f
> integer i,j
> loop: do i = 1, 5
> print *, i
> end do loop
> loop: do j = 1, 5
> print *, j
> end do loop
> end program f
>
> because the do-construct-name is not unique (Thanks,
> Richard for forsing me to read 14.1.2(1) several times).
> Note, a similar problem also affects if-construct-name
> and case-construct-name via gfc_match_label() in match.c.
Sounds like you want to call gfc_find_symbol from gfc_match_do, giving an
error if the symbol already exists.
- Tobi