[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bash Coding style - Adopting C99 declarations
From: |
Yair Lenga |
Subject: |
Bash Coding style - Adopting C99 declarations |
Date: |
Sun, 28 Aug 2022 10:47:38 -0400 |
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 flags;
int *validp;
{
intmax_t val;
int c;
procenv_t oevalbuf;
val = 0;
noeval = 0;
already_expanded = (flags&EXP_EXPANDED);
---
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 ? I believe some of those practices are discouraged
nowadays.
Yair