Collin Funk wrote:
> I don't blame you for not wanting to touch regex.
:)
> Maybe it is best to leave out all the files shared with glibc?
That was my original plan. But when I saw how much the readability of
the code was improved by this refactoring, I applied it also to files
shared with glibc. (Take a look e.g. at lib/str-two-way.h, function
'critical_factorization'. IMO it was impenetrable before, due to 7 local
variables declared upfront. Now this function has 3 local variables
at function scope.)
I think it will be worth the effort to push these refactorings (in
argp, glob, getopt etc.) into glibc.
> I skimmed some of the earlier changes in the patch and they looked good.
Thanks.
> > +* Note: You can't put a label before a declaration, such as in
> > + retry:
> > + int foo = ...;
> > + This is supported only in C23 or newer. Instead, add an empty statement:
> > + retry: ;
> > + int foo = ...;
> > + Similarly, you can't put a declaration immediately after a case label,
> > such
> > + as in
> > + case 1:
> > + int foo = ...;
> > + ...
> > + break;
> > + Again, this is supported only in C23 or newer. Instead, use a sub-block:
> > + case 1:
> > + {
> > + int foo = ...;
> > + ...
> > + }
> > + break;
>
> +1, definitely worth mentioning. I think I have accidental committed the
> declaration after label syntax a few times, because it is not obvious.
Yes. Paul warned me [1], and despite that, I made the first mistake two or three
times and the second mistake once. It's a pitfall for those of us who use
gcc 15 with the default options and the default AC_PROG_CC.
Bruno
[1] https://lists.gnu.org/archive/html/bug-gnulib/2025-11/msg00161.html