This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Weird bug from read-only namespace traversal


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]