Article View: comp.std.c++
Article #896Re: Responses to ~const 1.6: Possible generalizations of ~const
From: Joe Buck
Date: Mon, 04 Mar 1991 05:06
Date: Mon, 04 Mar 1991 05:06
34 lines
2117 bytes
2117 bytes
In article <4198@lupine.NCD.COM>, rfg@NCD.COM (Ron Guilmette) writes:
|> In article <NGO.91Feb19114034@tammy.harvard.edu> ngo@tammy.harvard.edu (Tom Ngo) writes:
|> +
|> +Background information to this posting was in a very recent summary.
|> +
|> ...
|> + ~volatile Do allow optimization on this object [even if the
|> + enclosing object is declared volatile].
|> +
|> +Joe Buck <jbuck@galileo.berkeley.edu> was against ~volatile on the
|> +grounds that it would add virtually nothing to the language; it would
|> +"give a tiny bit of useful information to an optimizing compiler,
|> +[but] it would gain nothing in expressive capability."
|> +
|> +Joe Buck and Ron Guilmette <rfg@ncd.com> felt that symmetry and
|> +simplicity of implementation might be good reasons to permit a
|> +~volatile specifier.
Tom makes it look like I contradict myself. No, I meant that ~volatile
doesn't get you much extra but you may as well throw it in to maintain
a uniform grammar, since volatile may appear anywhere that const can
at present.
|> One could argue that ~volatile has very little usefulness, however the
|> same could be said for `volatile' itself. Does that mean that we should
|> get rid of `volatile'? I think not.
There are places that volatile is needed, especially when interacting
with hardware, signals, and interrupt service routines. The "pre-volatile"
trick was putting in a comment saying "WARNING: don't use -O on this code".
--
Joe Buck
jbuck@galileo.berkeley.edu {uunet,ucbvax}!galileo.berkeley.edu!jbuck
Technical Details
Message-ID:
<11647@pasteur.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!tut.cis.ohio-state.edu!ucbvax!pasteur!galileo.berkeley.edu!jbuckReferences:
<NGO.91Feb19114034@tammy.harvard.edu> <4198@lupine.NCD.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!tut.cis.ohio-state.edu!ucbvax!pasteur!galileo.berkeley.edu!jbuck From: jbuck@galileo.berkeley.edu (Joe Buck) Newsgroups: comp.std.c++ Subject: Re: Responses to ~const 1.6: Possible generalizations of ~const Message-ID: <11647@pasteur.Berkeley.EDU> Date: 4 Mar 91 05:06:53 GMT References: <NGO.91Feb19114034@tammy.harvard.edu> <4198@lupine.NCD.COM> Sender: news@pasteur.Berkeley.EDU Reply-To: jbuck@galileo.berkeley.edu (Joe Buck) Distribution: comp Lines: 34