Bruno Haible via Gnulib discussion list <[email protected]> writes:

> Here comes the second part: Only the single-variable 'for' loops,
> and only in lib/.

Thanks! I got most of them in Coreutils, inspired by your changes [1].

Semi-related, but did pre-standard C not allow initialize variables upon
declaring them?

See this code copied from Coreutils src/basename.c:

    static void
    remove_suffix (char *name, char const *suffix)
    {
      char *np;
      char const *sp;
    
      np = name + strlen (name);
      sp = suffix + strlen (suffix);
    
      [...]
    }

Or maybe there was a requirement that expression was constant?

I thought about cleaning some of that up, but don't know the history
behind it.

Collin

[1] 
https://github.com/coreutils/coreutils/commit/be22a577933302b25a6edbae6d834d52d478e753

Reply via email to