From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Roman V. Shaposhnick" To: 9fans@cse.psu.edu Subject: Re: [9fans] how to avoid a memset() optimization Message-ID: <20021114044201.A11748@unicorn.math.spbu.ru> References: <01974d0bd36314a7c8172b6eca15effe@plan9.bell-labs.com>, <20021113042632.A6338@unicorn.math.spbu.ru> <3DD1DEBA.9040903@null.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <3DD1DEBA.9040903@null.net> Date: Thu, 14 Nov 2002 04:42:01 +0300 Topicbox-Message-UUID: 1e14dba0-eacb-11e9-9e20-41e7f4b1d025 On Wed, Nov 13, 2002 at 10:15:56AM +0000, Douglas A. Gwyn wrote: > Roman V. Shaposhnick wrote: > > The problem with volatile, of course, is that it is just a > > hint not a directive ( well, at least that's how I interpret > > C99 Standard ). > > I don't see how you can interpret the C standard that way. I don't have C99 standard handy, but here's what C++ ISO Standard says about volatile ( para 7.1.5.1 section 8 ): "Note: volatile is a hint to the implementation to avoid aggressive optimization involving the object because the value of the object might be changed by means undetectable by an implementation. " and since later on in the same section we read: "In general, the semantics of volatile are intended to be the same in C++ as they are in C." I assumed that for C99 it is also merely a hint. I'd be glad to be contradicted with factual information. Thanks, Roman.