bug-bash
[Top][All Lists]
Advanced

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

Re: The use of register keyword in bash source code


From: Andreas Schwab
Subject: Re: The use of register keyword in bash source code
Date: Wed, 06 Feb 2019 14:27:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.91 (gnu/linux)

On Feb 06 2019, Peng Yu <address@hidden> 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, address@hidden
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



reply via email to

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