[Top][All Lists]

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

Re: Bash Coding style - Adopting C99 declarations

From: Chet Ramey
Subject: Re: Bash Coding style - Adopting C99 declarations
Date: Mon, 29 Aug 2022 12:08:27 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.1.2

On 8/28/22 10:47 AM, Yair Lenga wrote:

I've noticed Bash code uses "old-style" C89 declarations:
* Parameters are separated from the prototype

Changing to C99-style function declarations is something that's on the list
to do.

* Variables declared only at the beginning of the function
* No mixed declaration/statements

These are indeed style issues that aren't of general concern.

* No block local variables

I use these in some cases where I think they make sense.

Curious as to the motivation of sticking to this standard for new
development/features. Specifically, is there a requirement to keep bash
compatible with C89 ?

For loadable builtins, there are no restrictions. For the mainline bash
code, I'd like to keep it consistent and change it all at once.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

reply via email to

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