From owner-sc22wg14+sc22wg14-domo2=www.open-std.org@open-std.org  Thu Oct 29 06:21:54 2015
Return-Path: <owner-sc22wg14+sc22wg14-domo2=www.open-std.org@open-std.org>
X-Original-To: sc22wg14-domo2
Delivered-To: sc22wg14-domo2@www.open-std.org
Received: by www.open-std.org (Postfix, from userid 521)
	id 31E713587E0; Thu, 29 Oct 2015 06:21:54 +0100 (CET)
Delivered-To: sc22wg14@open-std.org
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
	by www.open-std.org (Postfix) with ESMTP id 470853568B2
	for <sc22wg14@open-std.org>; Thu, 29 Oct 2015 06:21:48 +0100 (CET)
Received: from orsmga002.jf.intel.com ([10.7.209.21])
  by fmsmga102.fm.intel.com with ESMTP; 28 Oct 2015 22:21:46 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.20,213,1444719600"; 
   d="scan'208";a="837689360"
Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129])
  by orsmga002.jf.intel.com with ESMTP; 28 Oct 2015 22:21:45 -0700
Received: from orsmsx160.amr.corp.intel.com (10.22.226.43) by
 ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS)
 id 14.3.248.2; Wed, 28 Oct 2015 22:21:45 -0700
Received: from orsmsx103.amr.corp.intel.com ([169.254.2.240]) by
 ORSMSX160.amr.corp.intel.com ([169.254.13.248]) with mapi id 14.03.0248.002;
 Wed, 28 Oct 2015 22:21:45 -0700
From: "Nelson, Clark" <clark.nelson@intel.com>
To: "sc22wg14@open-std.org" <sc22wg14@open-std.org>
Subject: N1956: volatile semantics
Thread-Topic: N1956: volatile semantics
Thread-Index: AdESCbL/dOKA7ANdRdSS4LDK+4Owug==
Date: Thu, 29 Oct 2015 05:21:45 +0000
Message-ID: <38C37E44FD352B44ABFC58410B0790D090036AAC@ORSMSX103.amr.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.22.254.138]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Sender: owner-sc22wg14@open-std.org
Precedence: bulk

I don't know whether we're going to get back to this tomorrow, and even if =
we do, I don't know if Martin will be there. So I'll post my comments.

In the first place, I compared the C standard to the C++ standard where Mar=
tin proposes to modify the former. In only one of those places does the C++=
 standard use "lvalue" instead of "object". So I definitely think the C++ s=
tandard should be modified along the same lines.

Also, I think it might be better, from an editorial perspective, to define =
a new term, perhaps "volatile access", roughly as "use of a volatile lvalue=
", and then use that where needed. So, for example, we would wind up with s=
omething like "What constitutes a volatile access is implementation-defined=
."

In the first edit, to 5.1.2.3p2, the existing clause "modifying an object" =
was omitted -- inadvertently, I assume.

I noticed that 5.1.2.3p4, Douglas' particularly problematic statement, is e=
xpressed differently in the C++ standard. In the first place, it's a footno=
te. The complete text of the footnote is as follows:

"This provision is sometimes called the "as-if" rule, because an implementa=
tion is free to disregard any requirement of this International Standard as=
 long as the result is /as if/ the requirement had been obeyed, as far as c=
an be determined from the observable behavior of the program. For instance,=
 an actual implementation need not evaluate part of an expression if it can=
 deduce that its value is not used and that no side effects affecting the o=
bservable behavior of the program are produced."

I'm not necessarily suggesting that the C standard should explicitly mentio=
n the "as-if" rule, even in a footnote. But note that the second sentence, =
which corresponds directly to the sentence Martin proposes to modify, doesn=
't even contain the word "volatile", and (again) is definitely not normativ=
e. We should consider emulating this.

Clark
