From owner-sc22wg5@open-std.org  Thu Nov 13 09:07:55 2008
Return-Path: <owner-sc22wg5@open-std.org>
X-Original-To: sc22wg5-dom7
Delivered-To: sc22wg5-dom7@www2.open-std.org
Received: by www2.open-std.org (Postfix, from userid 521)
	id B01D9CA343B; Thu, 13 Nov 2008 09:07:55 +0100 (CET)
X-Original-To: sc22wg5@open-std.org
Delivered-To: sc22wg5@open-std.org
X-Greylist: delayed 319 seconds by postgrey-1.18 at www2.open-std.org; Thu, 13 Nov 2008 09:07:54 CET
Received: from sca-es-mail-2.sun.com (sca-es-mail-2.Sun.COM [192.18.43.133])
	by www2.open-std.org (Postfix) with ESMTP id 79A81C178D9
	for <sc22wg5@open-std.org>; Thu, 13 Nov 2008 09:07:54 +0100 (CET)
Received: from fe-sfbay-10.sun.com ([192.18.43.129])
	by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id mAD82RWs016955
	for <sc22wg5@open-std.org>; Thu, 13 Nov 2008 00:02:29 -0800 (PST)
Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0KA900901I7AF700@fe-sfbay-10.sun.com>
 (original mail from Robert.Corbett@Sun.COM) for sc22wg5@open-std.org; Thu,
 13 Nov 2008 00:02:27 -0800 (PST)
Received: from [129.146.84.104] by fe-sfbay-10.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 with ESMTPSA id <0KA900H79IC2EJ70@fe-sfbay-10.sun.com>; Thu,
 13 Nov 2008 00:02:27 -0800 (PST)
Date: Thu, 13 Nov 2008 00:02:26 -0800
From: Robert Corbett <Robert.Corbett@Sun.COM>
Subject: Re: (j3.2006) (SC22WG5.3673) [ukfortran] N1755: Request	for	new
	features from MPI Forum
In-reply-to: <20081113072205.9063AC178D9@www2.open-std.org>
To: fortran standards email list for J3 <j3@j3-fortran.org>
Cc: WG5 <sc22wg5@open-std.org>
Reply-To: Robert.Corbett@Sun.COM
Message-id: <491BDF12.8050108@sun.com>
Organization: Sun Microsystems, Inc.
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=us-ascii
Content-transfer-encoding: 7BIT
X-Accept-Language: en-us, en
References: <49137AD3.1070402@lrz.de>
 <20081111224927.8201CC178D9@www2.open-std.org>
 <20081111234923.517C5C178D6@www2.open-std.org>
 <20081112001017.26EB3C178D6@www2.open-std.org>
 <20081112091351.6581CC178D9@www2.open-std.org> <491BCB6F.8040406@sun.com>
 <20081113072205.9063AC178D9@www2.open-std.org>
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7.13) Gecko/20060509
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

Malcolm Cohen wrote:
> J3 readers, please remember to change your reply to WG5 when it's a WG5 
> message, otherwise it won't get through...
> 
> Robert Corbett wrote:
> 
>>N.M. Maclaren wrote:
>>  
>>
>>>Aargh!  No!  C 'const'!  It has NOT been a success - in fact, to describe
>>>it as a paving slab on the road to hell would be fair. [ Yes, I am referring
>>>to the saying that the road to hell is paved with good intentions. ]
>>>    
>>
>>The best example of that in Fortran 2003 is the PROTECTED attribute.
>>A casual reader of the standard is likely to believe that a variable
>>with the PROTECTED attribute cannot be modified outside of the module
>>in which it is contained.  A careful reading and the interps that
>>have been issued make it clear that PROTECTED is a promise made by
>>the programmer that he doesn't modifiy the variable outside of the
>>module
> 
> This is not correct;  to call it a "promise made by the programmer" is 
> not even remotely accurate.

The committe might have intended PROTECTED to be something other than
a promise made by the programmer, but the standard as written makes it
exactly that.  Just because INTENT(IN) has a similar defect does not
make it any the less true.

The standard as written allows a compiler to assume that a variable
that has the PROTECTED attribute is not definable outside the module,
but it allows programs to be written that define the variable outside
of the module and it does not require the processor to detect the error.
If a programmer writes a program that defines the variable outside the
module, it is not a standard-conforming program, and so a
standard-conforming processor is free to do anything whatever when
compiling or executing the program.  The onus is on the programmer to
avoid defining the variable outside the module.

Bob Corbett
