Re: Bash Coding style - Adopting C99 declarations

2022-08-29 Thread Chet Ramey
On 8/28/22 10:47 AM, Yair Lenga wrote: Hi, 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 * N

Re: Bash Coding style - Adopting C99 declarations

2022-08-28 Thread Martin D Kealey
On Mon, 29 Aug 2022 at 09:14, Dmitry Goncharov wrote: > On Sunday, August 28, 2022, Andreas Schwab wrote: > > Note that the next revision of the C standard removes support for K&R > > declarations > > The code will continue to compile, won't it? > I expect "gcc -std=c23" will reject such code.

Re: Bash Coding style - Adopting C99 declarations

2022-08-28 Thread Dmitry Goncharov
On Sunday, August 28, 2022, Andreas Schwab wrote: > On Aug 28 2022, Greg Wooledge wrote: > > > On Sun, Aug 28, 2022 at 10:47:38AM -0400, Yair Lenga wrote: > >> Hi, > >> > >> I've noticed Bash code uses "old-style" C89 declarations: > >> * Parameters are separated from the prototype > >> * Variabl

Re: Bash Coding style - Adopting C99 declarations

2022-08-28 Thread Andreas Schwab
On Aug 28 2022, Greg Wooledge wrote: > On Sun, Aug 28, 2022 at 10:47:38AM -0400, Yair Lenga wrote: >> Hi, >> >> I've noticed Bash code uses "old-style" C89 declarations: >> * Parameters are separated from the prototype >> * Variables declared only at the beginning of the function >> * No mixed de

Re: Bash Coding style - Adopting C99 declarations

2022-08-28 Thread Greg Wooledge
On Sun, Aug 28, 2022 at 10:47:38AM -0400, Yair Lenga wrote: > Hi, > > I've noticed Bash code uses "old-style" C89 declarations: > * Parameters are separated from the prototype > * Variables declared only at the beginning of the function > * No mixed declaration/statements > * No block local variab

Bash Coding style - Adopting C99 declarations

2022-08-28 Thread Yair Lenga
Hi, I've noticed Bash code uses "old-style" C89 declarations: * Parameters are separated from the prototype * Variables declared only at the beginning of the function * No mixed declaration/statements * No block local variables intmax_t evalexp (expr, flags, validp) char *expr; int flag