On Feb 06 2019, Peng Yu <pengyu...@gmail.com> wrote: > I see many variables are declared with the "register" keyword. I know > its purpose is to tell compile always access the corresponding memory > without assuming the previously accessed values are preserved. This is > usually to deal with some external devices.
No, that is what volatile means. The register keyword is just an optimisation hint, and is mostly ignored by the compiler. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."