[J3] [SC22WG5.6545] Why can't USE come after IMPLICIT NONE?

Damian Rouson rouson at lbl.gov
Sun Feb 18 20:44:27 UTC 2024


Implicit statements must come after use statements.  If you swap the
implicit and use statements, the code you provided compiles without error
with two compilers that I tried.

Damian

On Sun, Feb 18, 2024 at 12:31 PM Jeff Hammond via J3 <
j3 at mailman.j3-fortran.org> wrote:

> Can someone explain to me why the following is illegal?  Is there a risk
> that someone defines implicit variables in a module and that effect being
> invisible to the user?  Would it not have been better to exclude implicit
> variable declaration in modules?
>
> module m
>   implicit integer (a-z)
> end module m
>
> program main
>   implicit real (a-z)
>   use m
>   real x
> end program main
>
> Thanks,
>
> Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20240218/f2da75a8/attachment.htm>


More information about the J3 mailing list