This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: volatile semantics



On May 4, 2005, at 5:06 AM, Gabriel Dos Reis wrote:


Andrew Haley <aph@redhat.com> writes:

| Nathan Sidwell writes:
| > Dale Johannesen wrote:
| >
| > > And we don't have to document the behavior at all; it is not documented
| > > now.
| > I disagree. It's not documented explicitly in gcc now, because it is doing
| > what the std permits, and so documented there. We should document either
| >
| > a) that current gcc is not breaking the std, and Mike's example is invalid
| > code, if one expects a volatile read. This would be a FAQ like thing.

Both behaviors are standard-compliant. Treating a reference as volatile when
you don't have to just means strictly following the rules of the abstract machine;
it can never break anything.


I vote for (a).

[...]

| This is a bad extension to gcc and will cause much trouble, just like
| the old guarantee to preserve empty loops.

I see a difference between a documented extension, and quietly choosing
from among standard-compliant behaviors the one which is most convenient for
users.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]