[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] "register" and "volatile"

From: KHMan
Subject: Re: [Tinycc-devel] "register" and "volatile"
Date: Thu, 11 Dec 2008 16:43:39 +0800
User-agent: Thunderbird (Windows/20080708)

Jerry wrote:
Hi All,
As far as I know, a variable with "register" storage class will probably be optimized to be having no RAM storage but only staying in a CPU register. A "volatile" variable will only be read by RAM access. But what about a variable declared as volatile with register storage class?

"register" is advisory, it is up to the compiler to ultimately decide what to choose. "volatile" is mandatory, otherwise your program will break or work funny. You probably should read Derek Jones' The New C Standard (http://www.knosof.co.uk/cbook/cbook.html)

Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

reply via email to

[Prev in Thread] Current Thread [Next in Thread]