Re: The use of register keyword in bash source code

2019-02-06 Thread Andreas Schwab
On Feb 06 2019, Peng Yu wrote: > If it is ignored anyway, why "register" is used in many places in the > code? Thanks. Because compilers were dumb in the old days. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "A

Re: The use of register keyword in bash source code

2019-02-06 Thread Peng Yu
> No, that is what volatile means. The register keyword is just an > optimisation hint, and is mostly ignored by the compiler. If it is ignored anyway, why "register" is used in many places in the code? Thanks. -- Regards, Peng

Re: The use of register keyword in bash source code

2019-02-06 Thread Andreas Schwab
On Feb 06 2019, Peng Yu 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

The use of register keyword in bash source code

2019-02-06 Thread Peng Yu
Hi, 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. But I don't understand why it is usefu