From owner-sc22wg5+sc22wg5-dom9=www.open-std.org@open-std.org  Sun Feb 18 21:44:40 2024
Return-Path: <owner-sc22wg5+sc22wg5-dom9=www.open-std.org@open-std.org>
X-Original-To: sc22wg5-dom9
Delivered-To: sc22wg5-dom9@www.open-std.org
Received: by www.open-std.org (Postfix, from userid 521)
	id 3EF6B356D03; Sun, 18 Feb 2024 21:44:40 +0100 (CET)
Delivered-To: sc22wg5@open-std.org
Received: from mail-vs1-f42.google.com (mail-vs1-f42.google.com [209.85.217.42])
	by www.open-std.org (Postfix) with ESMTP id E76AC356CE1
	for <sc22wg5@open-std.org>; Sun, 18 Feb 2024 21:44:39 +0100 (CET)
Received: by mail-vs1-f42.google.com with SMTP id ada2fe7eead31-467ed334c40so594339137.0
        for <sc22wg5@open-std.org>; Sun, 18 Feb 2024 12:44:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=lbl.gov; s=google; t=1708289079; x=1708893879; darn=open-std.org;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=Te4qiQoFzl+hJOAh894nTziJeV9rrQTQmrbPKvLnE4E=;
        b=B8KzVHHzppOIuxgY4XBAIDS/TVphULbvt4B83i2Y8f+WZ9JVK8m01Fgv/ZszUaZFMr
         IbBrjjoB1z4J0irFoh5xbJM6+Bynfj8lK+VF4lNu/3yTHpteyVmw9mqKPjuiCxsZ5jBY
         jMKkjAPas2yr7C7blkPErcmLKOFX9A6vgLGVQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1708289079; x=1708893879;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=Te4qiQoFzl+hJOAh894nTziJeV9rrQTQmrbPKvLnE4E=;
        b=op/+d/2q9qnRb5K+RHh5GKzAsbmkW8ooquUdolRUygdSiJsapj9Nc3TolNFEYVgI9h
         8ip7G0vZCNPudEuhrOuUgbxfXqbHg3n//8pOxkzQzAJ8ciOEdIOIXvU9D6TMv4b4acic
         XEXowP4YPoDhz98T/+/PWIW9BWTHpIavw0d4XDxfbi3Yxj/MctH+uIleFjJfE3my53sh
         tGgp58InbroXrZMq74KX1oi3w2OTNj0BGR3Cw1GvbfUhqXgVEojxsJhNOuMDJB2hrnNj
         8grBUF/8LSQFLPIfMuU/Rj5GoLuEL3F8V8ZvLycY9te7Cp72ouPkkhCpsgodalxeFSlQ
         9pMg==
X-Gm-Message-State: AOJu0YwB0aGoHKyRpDt9ZHcm/0Rk1CkEl7jPvBhwHK5yDLA2c+NZCFxE
	WdYF6ba3TUtUZBBH8niYlCTTus8lD2+XAZWfrkmQ+Oh9WvF1Oszvz8zcCMn0vh/1JaDl0kja6eP
	RzemzBoTvWO6kGsuLlG2EzSa1U5i1P74Y+4FLWLlWgj+Dq45CBC+HfCf3QSGzgjQe3gSqj8WICE
	pteUjK130beVZ/FOekRT83r6YhL2K/chu3E2K1kpjCQry/IbJMmuvf58y3Rjt8md/W0b4xpSuHl
	Y/WYXF1W9Z/fRM=
X-Google-Smtp-Source: AGHT+IH5vPXVYqoe5VOfNwNW+gtvAeCPUBoSfVuH9hVmXddmZ342M0Bvlfvv6rJCtuBuhp3GRcuCsUz4Bg6CqyQmD3s=
X-Received: by 2002:a05:6102:456:b0:470:4515:7ba7 with SMTP id
 e22-20020a056102045600b0047045157ba7mr3864423vsq.3.1708289078598; Sun, 18 Feb
 2024 12:44:38 -0800 (PST)
MIME-Version: 1.0
References: <20240218203142.DE815356D03@www.open-std.org>
In-Reply-To: <20240218203142.DE815356D03@www.open-std.org>
From: Damian Rouson <rouson@lbl.gov>
Date: Sun, 18 Feb 2024 12:44:27 -0800
Message-ID: <CAM2rSoX2-bUc5Db5O=h7MNA1jrYe_+M2jAnaVScCh9GxCj5JAQ@mail.gmail.com>
Subject: Re: [J3] [SC22WG5.6544] Why can't USE come after IMPLICIT NONE?
To: General J3 interest list <j3@mailman.j3-fortran.org>
Cc: WG5 <sc22wg5@open-std.org>, Jeff Hammond <jehammond@nvidia.com>
Content-Type: multipart/alternative; boundary="000000000000b4e9430611ae0b36"
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

--000000000000b4e9430611ae0b36
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

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=E2=80=AFPM Jeff Hammond via J3 <
j3@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

--000000000000b4e9430611ae0b36
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Implicit statements must come after use statements.=C2=A0 =
If you swap the implicit and use statements, the code you provided compiles=
 without error with two compilers that I tried.<div><br></div><div>Damian</=
div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_at=
tr">On Sun, Feb 18, 2024 at 12:31=E2=80=AFPM Jeff Hammond via J3 &lt;<a hre=
f=3D"mailto:j3@mailman.j3-fortran.org">j3@mailman.j3-fortran.org</a>&gt; wr=
ote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px=
 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(=
204,204,204);padding-left:1ex">Can someone explain to me why the following =
is illegal?=C2=A0 Is there a risk that someone defines implicit variables i=
n a module and that effect being invisible to the user?=C2=A0 Would it not =
have been better to exclude implicit variable declaration in modules?<br>
<br>
module m<br>
=C2=A0 implicit integer (a-z)<br>
end module m<br>
<br>
program main<br>
=C2=A0 implicit real (a-z)<br>
=C2=A0 use m<br>
=C2=A0 real x<br>
end program main<br>
<br>
Thanks,<br>
<br>
Jeff</blockquote></div>

--000000000000b4e9430611ae0b36--
