[PATCH 6/7] maint: add function attributes to .h files

2021-10-31 Thread Paul Eggert
Add _GL_ATTRIBUTE_NONNULL, _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DALLOC_FREE, _GL_ATTRIBUTE_RETURNS_NONNULL to .h files when appropriate. * gl/lib/mbsalign.h, gl/lib/randperm.h, src/chown-core.h: Include stdlib.h, for the benefit of _GL_ATTRIBUTE_DALLOC_FREE. *

[PATCH 2/7] b2sum: simplify attribute usage

2021-10-31 Thread Paul Eggert
* src/blake2/blake2.h (BLAKE2_PACKED): Simplify, and port better to older GCC, by using _GL_ATTRIBUTE_PACKED. --- src/blake2/blake2.h | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/blake2/blake2.h b/src/blake2/blake2.h index 3960bdb2d..dc4672d1d 100644

[PATCH 4/7] maint: modernize attribute usage

2021-10-31 Thread Paul Eggert
* src/system.h (__attribute__): Remove. Replace all uses that rely on this by _GL_ATTRIBUTE_xxx or ATTRIBUTE_xxx. (ATTRIBUTE_WARN_UNUSED_RESULT): Remove. Replace all uses by NODISCARD. --- src/prog-fprintf.h | 2 +- src/stat.c | 36 src/stty.c

[PATCH 1/7] maint: prefer attribute.h in .c files

2021-10-31 Thread Paul Eggert
This will help us make the transition to C2x, where some attributes must come at the start of function decls. Leave the attributes alone in .h files for now, as the Gnulib tradition is to not expose attribute.h to users. * bootstrap.conf (gnulib_modules): Add ‘attribute’. * gl/lib/randperm.c,

[PATCH 7/7] maint: use minmax.h instead of rolling our own

2021-10-31 Thread Paul Eggert
* gl/lib/mbsalign.c, gl/lib/randread.c, src/system.h (MAX, MIN): Remove; include minmax.h instead. * gl/modules/mbsalign, gl/modules/randread (Depends-on): Add minmax. * src/factor.c (MIN): Remove. --- gl/lib/mbsalign.c | 6 ++ gl/lib/randread.c | 5 + gl/modules/mbsalign | 1 +

[PATCH 3/7] maint: remove unused __attribute__ defn

2021-10-31 Thread Paul Eggert
* gl/lib/randread.c (__attribute__): Remove; no longer used after the recent _Noreturn change. --- gl/lib/randread.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/gl/lib/randread.c b/gl/lib/randread.c index 5ed42b547..6c29a62e4 100644 --- a/gl/lib/randread.c +++ b/gl/lib/randread.c @@

[PATCH 5/7] maint: enable -Wsuggest-attribute=format

2021-10-31 Thread Paul Eggert
* configure.ac (WERROR_CFLAGS): Enable -Wsuggest-attribute=format for lib/ and src/. * src/copy.c (copy_attr_error, copy_attr_allerror): Add ATTRIBUTE_FORMAT. (copy_attr): Ignore -Wsuggest-attribute=format in the small section of code that needs it ignored. * src/test.c (test_syntax_error): Mark

bug#51433: cp 9.0 sometimes fails with SEEK_DATA/SEEK_HOLE

2021-10-31 Thread Pádraig Brady
On 28/10/2021 20:11, Paul Eggert wrote: On 10/28/21 06:54, Pádraig Brady wrote: Further debugging from Nix folks suggest ZFS was in consideration always, as invalid artifacts were written to a central cache from ZFS backed hosts. So we should at least change the comment in the patch to only

bug#51433: cp 9.0 sometimes fails with SEEK_DATA/SEEK_HOLE

2021-10-31 Thread Pádraig Brady
On 30/10/2021 03:04, Paul Eggert wrote: On 10/28/21 13:59, Pádraig Brady wrote: I wonder after getting a SEEK_DATA ENXIO, might we correlate we really are at end of file by checking SEEK_HOLE also returns ENXIO? Wouldn't SEEK_HOLE return the current offset, instead of ENXIO? That is, if the

bug#51433: cp 9.0 sometimes fails with SEEK_DATA/SEEK_HOLE

2021-10-31 Thread Paul Eggert
On 10/31/21 09:13, Pádraig Brady wrote: The attached uses statfs()->f_type which is usually available, to avoid using SEEK_DATA on ZFS.  This should be fairly lightweight I think, and only used for files that might be sparse. Couldn't we be even lazier about invoking fstatfs? It needs to be

bug#51011: [PATCH] sort: --debug: add warnings about radix and grouping chars

2021-10-31 Thread Pádraig Brady
On 11/10/2021 02:54, Pádraig Brady wrote: On 11/10/2021 00:34, Paul Eggert wrote: The warnings look good, except that this one:   $ printf '1.0\n0.9\n' | sort -s -k1,1g --debug   sort: numbers use ‘.’ as a decimal point in this locale   0.9   ___   1.0   ___ seems overkill

bug#51011: [PATCH] sort: --debug: add warnings about radix and grouping chars

2021-10-31 Thread Paul Eggert
Thank you for working on this. Your points are well taken. One tiny comment: + if (basic_numeric_field) +{ + if (thousands_sep_ignored) This might be better combined as "if (basic_numeric_field && thousands_sep_ignored)", so that it's more similar to the previous "if".