Article View: comp.std.c
Article #1102Re: Interpretation of volatile - two questions
From: Henry Spencer
Date: Mon, 19 Mar 1990 16:59
Date: Mon, 19 Mar 1990 16:59
21 lines
1274 bytes
1274 bytes
In article <2604A628.8521@paris.ics.uci.edu> rfg@paris.ics.uci.edu (Ronald Guilmette) writes:
> struct s {
> char c1;
> volatile char c2;
> };
>...
> c = memory_mapped_device_p->c1;
>...
>does the standard (a) permit, (b) require, or (c) prohibit the assignment
>statement shown to access the c2 field of the "struct s" pointed to by
>memory_mapped_device_p?
The standard, by and large, is silent about the *details* of how volatile
works. Necessarily so; it's very machine-specific. Suppose your machine's
bus only does word accesses, and it *cannot* access c1 without also
touching c2? In general, you have to know the machine and the compiler
to know the exact semantics in such situations; the method of specifying
volatility is machine-independent, but the results are not.
--
MSDOS, abbrev: Maybe SomeDay | Henry Spencer at U of Toronto Zoology
an Operating System. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu
Technical Details
Message-ID:
<1990Mar19.165931.22758@utzoo.uucp>Path:
arc1-ca.pugleaf.net!utzoo!henryReferences:
<2604A628.8521@paris.ics.uci.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Interpretation of volatile - two questions Message-ID: <1990Mar19.165931.22758@utzoo.uucp> Organization: U of Toronto Zoology References: <2604A628.8521@paris.ics.uci.edu> Date: Mon, 19 Mar 90 16:59:31 GMT