[J3] [SC22WG5.6547] Why can't USE come after IMPLICIT NONE?
Steve Lionel
steve at stevelionel.com
Sun Feb 18 21:35:36 UTC 2024
This of course dates back to Fortran 90, long before I was on the
committee, but perhaps it was done to prevent confusion as to whether
IMPLICIT would have an effect on the USE that follows. It wouldn't,
because any implicit typing is resolved when the module is compiled,
thus an IMPLICIT in the host scope would not affect any use-associated
entities.
I see Van has made a better observation.
Even if this rule were relaxed, though, it would not help you. Consider:
program main
implicit none
real :: foo
include 'mpif.h'
...
I'm skeptical that having mpif.h be a use mpi would work for everyone
regardless, as there wold be scoping rule differences.
On 2/18/2024 3:31 PM, Jeff Hammond via J3 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?
Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20240218/c9f32edd/attachment.htm>
More information about the J3
mailing list