tinycc-devel
[Top][All Lists]
Advanced

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

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


From: Jerry
Subject: Re: [Tinycc-devel] "register" and "volatile"
Date: Thu, 11 Dec 2008 17:23:20 +0800

Thanks. :)

2008/12/11 KHMan <address@hidden>
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)

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


_______________________________________________
Tinycc-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/tinycc-devel



--
Best Regards
-----------
Jerry Luo

reply via email to

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