public and private access in modules

Daniel Franke franke.daniel@gmail.com
Tue Aug 22 20:17:00 GMT 2006


On Tuesday 22 August 2006 17:06, Richard E Maine wrote:
> On Aug 22, 2006, at 3:21 AM, Daniel Franke wrote:
> > The code below defines a type t, which is private the module. The
> > variable instance is public. While the Intel Fortran Compiler
> > complains that the types instance must be private because its type is,
> > gfortran happily compiles this code...
> > I don't know what the standard recommends. Is this an issue in
> > gfortran or is ifort overly protective?
>
> The standard has only a few recommendations, none related to this. It
> mostly has requirements, some of which are related. Just a wording
> correction, I realize. But in the standard, the distinction between a
> requirement and a recommendation is fundamental and explicit. That's
> at the core of what standards are about. So it is a bit of wording
> that I'm particularly sensitized to.

Noted. Please accept my apologies.


> The code violates a constraint in f95 (10th constraint after R506).
> Thus the code is non-standard and the Intel compiler is correct.
> Compilers are required to have the capability to diagnose constraint
> violations. If gfortran does not have such a capability, it is in
> violation of the standard. However, the diagnosis is not required to
> be turned on by default. Given the switches you used, I suspect that
> gfortran doesn't have the required diagnosis capability for this one,
> but I can't directly verify that.
>
> Note however, that this constraint is removed in f2003. Thus allowing
> the code could be considered an f2003 feature. F95 compliance still
> requires the capability of diagnosing it, but one might well imagine
> it as reasonable for that diagnosis to be off by default.

Richard, thanks for the explanation. 
Taking Paul's reply into account, I don't have to file a PR for this?

Regards
	Daniel



More information about the Fortran mailing list