Re: volatile

From: Ravi (ravi_at_despammed.com)
Date: 10/12/03


Date: Mon, 13 Oct 2003 00:33:44 +0530

On Sun, 12 Oct 2003 14:35:01 -0400, Sheldon Simms
<sheldonsimms@yahoo.com> wrote:

>Footnote 114 in the C standard explains it like this:
>
> A volatile declaration may be used to describe an object
> corresponding to a memory-mapped input/output port or an
> object accessed by an asynchronously interrupting function.
> Actions on objects so declared shall not be optimized out
> by an implementation or reordered except as permitted by
> the rules for evaluating expressions.
I've read these things.

I understand this. But I want a proper example clearly
telling me the use of declaring a variable volatile etc.

TIA.

-- 
main(){char s[40]="sbwjAeftqbnnfe/dpn!ps!CSbwjACjhgppu/dpn";
int i;for(i=0;i<39;putchar(s[i++]-1));return 0;}


Relevant Pages

  • Re: [PATCH] kernel 2.6.11.6 - I2C adaptor for ColdFire 5282 CPU
    ... | Enclosed please find the updated patch that incorporates changes for all ... | The volatile declaration in the m528xsim.h is needed because the ... | declaration refers to the ColdFire 5282 register mapping. ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH] kernel 2.6.11.6 - I2C adaptor for ColdFire 5282 CPU
    ... > Enclosed please find the updated patch that incorporates changes for all ... > The volatile declaration in the m528xsim.h is needed because the ... > declaration refers to the ColdFire 5282 register mapping. ... - Please reissue the changelog each time you reissue a patch. ...
    (Linux-Kernel)
  • Re: volatile
    ... >> A volatile declaration may be used to describe an object ... Any proper example would probably be implementation dependent. ...
    (comp.lang.c)
  • Re: Doctors oath in Britain?
    ... Tia. ... Declaration of Geneva, at graduation. ...
    (sci.med)
  • Re: Warnings compiling a KLD #including vnode.h
    ... >> declaration, which is probably not what you want ... Why are they not kept(like other headers) in the ... TIA. ... Regards, ...
    (freebsd-hackers)