Re: volatile Info



On Aug 6, 4:26 am, Malcolm McLean <malcolm.mcle...@xxxxxxxxxxxxxx>
wrote:
On Aug 6, 3:11 am, crisgoogle <crisgoo...@xxxxxxxxx> wrote:>
So I think Scott's question stands: how is the
answer different _without_ the "volatile"? If there's some bizarre mechanism
by which the value of, uh, "value" could change, then the returned result
may not be be the square of the original argument.

"volatile" is shorthand for "there is some bizarre mechanism by which
the value of this variable might change".

Okay. But is the _absence_ of volatile shorthand for "there is NO
bizarre
mechanism by which the value of this variable might change"? I don't
think
so.

So I ask yet again: without the "volatile", how does the answer to the
original
question change?

(I tried to fix GG's quoting. Sorry if I failed).
.



Relevant Pages

  • Re: volatile Info
    ... int square ... His question was Will this function return square of the argument ... The volatile in the argument for value refers to ... that means that every heap pointer on the stack needs to be altered. ...
    (comp.lang.c)
  • Re: volatile Info
    ... Walter Banks writes: ... int square ... His question was Will this function return square of the argument ... The volatile in the argument for value refers to ...
    (comp.lang.c)
  • Re: volatile Info
    ... int square ... His question was Will this function return square of the argument ... as the argument is volatile. ... the same on any common hardware (essentially all hardware ...
    (comp.lang.c)
  • Re: volatile Info
    ... int square ... His question was Will this function return square of the argument ... be sure what the result will be if 'volatile' is left off. ... Ditto and double ditto. ...
    (comp.lang.c)
  • Re: volatile Info
    ... int square ... His question was Will this function return square of the argument ... The volatile in the argument for value refers to ... An implementation may have to use two accesses on the actual machine, ...
    (comp.lang.c)