Re: [PATCH v2 00/10] Code hygiene fixes from grub

2021-12-01 Thread Paul Eggert
On 12/1/21 18:00, Bruno Haible wrote: I will go through your patches this Friday, except for the regex ones, that I'll leave to Paul. Thanks for the re-submission and the patience. Yes, thanks for going to all that work. Some of the other patches look good but I'll let Bruno take a look.

Re: [PATCH v2 08/10] Fix up a bunch of "gcc -Werror=sign-compare" complaints

2021-12-01 Thread Paul Eggert
On 12/1/21 13:02, Robbie Harwood wrote: diff --git a/lib/argp-fmtstream.c b/lib/argp-fmtstream.c index f679751b9..4aa401e2d 100644 --- a/lib/argp-fmtstream.c +++ b/lib/argp-fmtstream.c @@ -234,7 +234,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs) else { size_t displ

Re: [PATCH v2 05/10] Make gnulib's regcomp not abort()

2021-12-01 Thread Paul Eggert
On 12/1/21 13:02, Robbie Harwood wrote: @@ -1099,7 +1099,7 @@ optimize_utf8 (re_dfa_t *dfa) } break; default: - abort (); + break; } Likewise, it's not clear why this change is needed. The 'abort' should not be reachable. Is the intent to make the

Re: [PATCH v2 05/10] Make gnulib's regcomp not abort()

2021-12-01 Thread Paul Eggert
It's not clear why this change is needed. POSIX says that for regerror "the application shall ensure is the last non-zero value returned by regcomp() or regexec() with the given value of preg". If an application violates a "shall" requirement, behavior is undefined so it's OK for regerror to ab

Re: [PATCH v2 03/10] gnulib/regexec: Resolve unused variable

2021-12-01 Thread Paul Eggert
On 12/1/21 13:01, Robbie Harwood wrote: The reason for this issue is that we are not building with DEBUG set and this in turn means that the assert() that reads the value of the variable match_last is being processed out. Could you explain what goes wrong? regexec_internal.h does this: #if de

Re: [PATCH v2 02/10] gnulib/regexec: Fix possible null-dereference

2021-12-01 Thread Paul Eggert
On 12/1/21 13:01, Robbie Harwood wrote: It appears to be possible that the mctx->state_log field may be NULL, I don't see how. re_search_internal sets mctx.state_log to a non-null value if dfa->has_mb_node, and clean_state_log_if_needed should be called only if dfa->has_mb_node is true. What

Re: [PATCH v2 00/10] Code hygiene fixes from grub

2021-12-01 Thread Bruno Haible
Hello Robbie, I will go through your patches this Friday, except for the regex ones, that I'll leave to Paul. Thanks for the re-submission and the patience. Bruno

[PATCH v2 02/10] gnulib/regexec: Fix possible null-dereference

2021-12-01 Thread Robbie Harwood
From: Darren Kenny It appears to be possible that the mctx->state_log field may be NULL, and the name of this function, clean_state_log_if_needed(), suggests that it should be checking that it is valid to be cleaned before assuming that it does. Fixes: CID 86720 Signed-off-by: Darren Kenny Rev

[PATCH v2 04/10] Fix width computation

2021-12-01 Thread Robbie Harwood
From: Vladimir 'phcoder' Serbinenko Signed-off-by: Robbie Harwood --- lib/argp-fmtstream.c | 80 +--- lib/argp-help.c | 3 +- lib/mbswidth.c | 15 + lib/mbswidth.h | 4 +++ 4 files changed, 88 insertions(+), 14 deletions(-) dif

[PATCH v2 08/10] Fix up a bunch of "gcc -Werror=sign-compare" complaints

2021-12-01 Thread Robbie Harwood
From: Peter Jones [rharw...@redhat.com: rebase conflicts in regexec, regcomp] Signed-off-by: Robbie Harwood --- lib/argp-fmtstream.c | 2 +- lib/regcomp.c| 28 +++- lib/regex_internal.c | 6 +++--- lib/regexec.c| 36

[PATCH v2 05/10] Make gnulib's regcomp not abort()

2021-12-01 Thread Robbie Harwood
From: Vladimir 'phcoder' Serbinenko [rharw...@redhat.com: we wrote a commit message] Signed-off-by: Robbie Harwood --- lib/regcomp.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/regcomp.c b/lib/regcomp.c index 6a97fdee4..a8cefebf1 100644 --- a/lib/regcomp.c ++

gnulib fails for build on Mac OS X 10.4: get_ppid_of.c:36:22: error: libproc.h: No such file or directory

2021-12-01 Thread Ryan Schmidt
Hi, gnulib fails to build on Mac OS X 10.4 Tiger: get_ppid_of.c:36:22: error: libproc.h: No such file or directory libproc.h was introduced in Mac OS X 10.5 Leopard. This problem affects gettext 0.21 which includes this version of gnulib. This is a problem because so many things depend on gette

[PATCH v2 06/10] Make CFLAGS less painful

2021-12-01 Thread Robbie Harwood
From: Peter Jones Signed-off-by: Peter Jones [rharw...@redhat.com: make rpm gunk conditional] Signed-off-by: Robbie Harwood --- gnulib-tool | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gnulib-tool b/gnulib-tool index 9c4a6c17e..24cdbe2da 100755 --- a/gnulib-t

[PATCH v2 10/10] Fixup for -Werror=ignored-qualifiers issues

2021-12-01 Thread Robbie Harwood
From: Peter Jones Signed-off-by: Peter Jones Signed-off-by: Robbie Harwood --- lib/argp-fmtstream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/argp-fmtstream.c b/lib/argp-fmtstream.c index 4aa401e2d..d870716da 100644 --- a/lib/argp-fmtstream.c +++ b/lib/argp-fmtstr

[PATCH v2 03/10] gnulib/regexec: Resolve unused variable

2021-12-01 Thread Robbie Harwood
From: Darren Kenny This is a really minor issue where a variable is being assigned to but not checked before it is overwritten again. The reason for this issue is that we are not building with DEBUG set and this in turn means that the assert() that reads the value of the variable match_last is b

[PATCH v2 09/10] Paper over a stringop-overflow warning about wide char handling

2021-12-01 Thread Robbie Harwood
From: Peter Jones [rharw...@redhat.com: rewrote commit message] Signed-off-by: Robbie Harwood --- lib/vasnprintf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index 360ca6948..7faa11753 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -234,8

[PATCH v2 01/10] argp-parse.c (__argp_input): Don't crash if pstate is NULL

2021-12-01 Thread Robbie Harwood
From: Colin Watson [rharw...@redhat.com: tweaked commit message] Signed-off-by: Robbie Harwood --- lib/argp-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/argp-parse.c b/lib/argp-parse.c index 053495ec0..4f1c65d73 100644 --- a/lib/argp-parse.c +++ b/lib/argp-par

[PATCH v2 07/10] Fix __argp_fmtstream_point()'s return type and comparisons with it

2021-12-01 Thread Robbie Harwood
From: Peter Jones gcc -Werror=sign-compare produces: argp-help.c:1545:15: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare] 1545 | > __argp_fmtstream_lmargin (stream)) | ^ Som

[PATCH v2 00/10] Code hygiene fixes from grub

2021-12-01 Thread Robbie Harwood
Hello gnulib, This is a slightly updated version of our collected grub2 patches to gnulib. In addition to rebasing around changes to the development branch, I've also dropped the base64 patch since it was preferred to make the change in grub. While that generated additional dicsussion that I hop