This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Weird bug from read-only namespace traversal
- From: FX <fxcoudert at gmail dot com>
- To: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- Cc: fortran at gcc dot gnu dot org
- Date: Thu, 9 Oct 2014 23:32:54 +0200
- Subject: Re: Weird bug from read-only namespace traversal
- Authentication-results: sourceware.org; auth=none
- References: <20140930090258 dot GB31712 at physik dot fu-berlin dot de>
OK, Iâm getting back to that after a break. I have urgent things to do, so I need to procrastinate :)
> Regarding "is_ieee_module_used", I wonder whether that will work with
>
> module m
> use ieee_exceptions
> contains
> subroutine foo() ! <<< This one
> end subroutine
> end module m
>
> Or with:
> subroutine bar()
> use ieee_exceptions
> contains
> subroutine foobar() ! << This one
> end subroutine foobar
> end subroutine
No, indeed, it does not. Thanks.
> Additionally, I have the feeling that you search the wrong namespace:
> sym->ns for the procedure "foo" is probably the one of "module m" and not
> the one of "subroutine foo". - But I might be wrong.
>
> Searching all symbols in order to check whether the modules have been
> loaded seems to be inefficient. I wonder whether adding an
> unsigned uses_ieee_module:1;
> to the gfc_namespace - and propagating it in gfc_get_namespace() from
> the parent wouldn't be the smarter solution. (You still have to ensure
> that you use the right namespace for the function.)
This seems weird, because gfc_get_namespace() does not appear to otherwise deal with inheriting traits from the parent (apart from implicit types).
Iâm probably in over my head here, because association in Fortran has always been somewhat hard for me to grasp completely.
FX