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 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);

You're mistaken.  What you're seeing is the "K&R" coding style, which
predates C89.

I'm pretty sure that the decision to continue in this style well past
the widespread adoption of C89 was because of a desire to use bash on
systems that still had a K&R C compiler.  A lot of the oldest GNU projects
followed this idea, in order to increase the number of commercial Unix
systems on which they could be used.

Reply via email to