From owner-sc22wg5@open-std.org  Fri Nov 14 03:10:49 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 4A761CA5FE5; Fri, 14 Nov 2008 03:10:49 +0100 (CET)
X-Original-To: sc22wg5@open-std.org
Delivered-To: sc22wg5@open-std.org
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 5EBDFC178D6
	for <sc22wg5@open-std.org>; Fri, 14 Nov 2008 03:10:47 +0100 (CET)
Received: from fe-sfbay-09.sun.com ([192.18.43.129])
	by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id mAE2Ad66009216
	for <sc22wg5@open-std.org>; Thu, 13 Nov 2008 18:10:42 -0800 (PST)
Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0KAA00B01WK6W300@fe-sfbay-09.sun.com>
 (original mail from Robert.Corbett@Sun.COM) for sc22wg5@open-std.org; Thu,
 13 Nov 2008 18:10:39 -0800 (PST)
Received: from [129.146.84.104] by fe-sfbay-09.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 with ESMTPSA id <0KAA00313WPO7W40@fe-sfbay-09.sun.com>; Thu,
 13 Nov 2008 18:10:37 -0800 (PST)
Date: Thu, 13 Nov 2008 18:10:36 -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: <491CD5CB.4030003@cray.com>
To: longb@cray.com
Cc: WG5 <sc22wg5@open-std.org>
Reply-To: Robert.Corbett@Sun.COM
Message-id: <491CDE1C.8050003@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> <491BDF12.8050108@sun.com>
 <491CD5CB.4030003@cray.com>
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

Bill Long wrote:
> 
> 
> Robert Corbett wrote:
> 
>> 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.
> 
> The first sentence says the standard allows a programmer to do X.  The 
> second one seems to say that IF the programmer does X, the program is 
> not standard conforming.   That seems a bit contradictory.

I shall attempt to state it more clearly.

Programs can be written that are not standard-conforming, but a compiler
cannot practically detect that they are not standard conforming.  In
particular, violations of the restrictions imposed on deinition of a
variable with the PROTECTED attribute cannot be detected in all cases.
Thus, the standard effectively requires a processor to successfully
compile programs that are not standard conforming to avoid rejecting
some programs that are standard conforming.

I can easily imagine a scheme for detecting abuse of variables with the
PROTECTED attribute at run-time, but only at a prohibitive cost.

Bob Corbett
