Re: coreutils-9.4.170-7b206 ls/removed-directory test failure

2024-03-26 Thread Paul Eggert
On 3/26/24 11:35, Pádraig Brady wrote: Actually the FreeBSD system ls(1) does _not_ show the error in this case (it doesn't use readdir I think). If I'm reading the source code aright, FreeBSD ls uses fts, which does use readdir. It's not clear to me whether it's intended that the readdir err

Re: coreutils-9.4.170-7b206 ls/removed-directory test failure

2024-03-26 Thread Paul Eggert
On 3/26/24 10:50, Pádraig Brady wrote: It seems that readdir() on FreeBSD 14 is _not_ eating the ENOENT from getdirentries(). Attached is an extra check for that, that avoids the test in that case. An alternative would be for ls to ignore the ENOENT from readdir(). Paul what do you think? My

Re: sort dynamic linking overhead

2024-02-27 Thread Paul Eggert
Thanks for the patch. I was hoping that we didn't need to worry about older platforms needing -ldl. Oh well. The patch causes 'configure' to search for dlopen even when there's no crypto library. 'configure' could instead use AC_SEARCH_LIBS only if the AC_LINK_IFELSE fails (or simply put AC_LI

Re: sort dynamic linking overhead

2024-02-26 Thread Paul Eggert
On 2024-02-26 06:12, Pádraig Brady wrote: On 26/02/2024 06:44, Yann Collet wrote:   * xxhash128 is not a cryptographic hash function, so it doesn't attempt tobe random. Just a correction : xxh128 does try to be random. And quite hardly: a significant amount of development is spent on ensuring

Re: sort dynamic linking overhead

2024-02-26 Thread Paul Eggert
tions, I didn't see where libcrypto (at least on Ubuntu 23.10, which has OpenSSL 3.0.10) takes advantage of these special-purpose instructions.From 7f57ac2d20c144242953a8dc7d95b02df0244751 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 25 Feb 2024 17:13:12 -0800 Subject: [PATCH] so

better i18n for join, uniq, etc.

2023-10-30 Thread Paul Eggert
p; c_isxdigit (to_uchar (b[1]))) { int esc_value = hextobin (b[1]); /* Value of \xhh escape. */ /* A hexadecimal \xhh escape sequence must have 1 or 2 hex. digits. */ ++b; - if (isxdigit (to_uchar (b[1]))) + if (c_isxd

Re: [PATCH] build: avoid use of C11 specific %t format size spec

2023-08-01 Thread Paul Eggert
On 2023-08-01 06:28, Pádraig Brady wrote: perhaps we can now use %j, %t, and %z now? I hope so, particularly as we haven't seen any issues with Coreutils 9.1 or later. I haven't run into problems using these printf formats for a while. Gnulib doc is ambiguous, but suggests it could be an is

Re: [PATCH] maint: use stdckdint C23 routines rather than gnulib MACROS

2023-07-04 Thread Paul Eggert
On 2023-07-04 04:08, Pádraig Brady wrote: Paul has now done this in: https://github.com/coreutils/coreutils/commit/d727aba60 Oh, sorry, I hadn't seen the change that you circulated earlier. If there's any other pending changes like that, it'd be nice to get them installed too. Could I help w

Re: nstrftime.c fails to build due to memset overflow

2023-05-18 Thread Paul Eggert
On 5/18/23 14:50, Bruno Haible wrote: But when "gcc -Wall" reports 10 warnings to me, and I don't notice that one of them is an actual bug because I mentally discard all of them If you're using -O0, then in my experience it's a mistake to also use --enable-gcc-warnings, as the combination gene

Re: nstrftime.c fails to build due to memset overflow

2023-05-18 Thread Paul Eggert
--- a/configure.ac +++ b/configure.ac @@ -261,6 +261,11 @@ if test $gl_gcc_warnings != no; then # FP in careadlinkat.c w/gcc 10.0.1 20200205 gl_WARN_ADD([-Wno-return-local-addr]) + # FIXME: remove this line when gcc improves + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443 + # FP

Re: nstrftime.c fails to build due to memset overflow

2023-05-18 Thread Paul Eggert
Let's revert the "avoid incorrect -Wmaybe-uninitialized warnings" patch. --enable-gcc-warnings is designed for the default gcc -O2, and we shouldn't dumb down our source code for lesser platforms like "gcc -O0", or clang, or whatever. For example, this patch: - int dest_desc; - int dest_e

Re: requiring 64-bit time_t again in coreutils; off_t too?

2023-04-19 Thread Paul Eggert
On 2023-04-19 13:40, Pádraig Brady wrote: I see the following adjustment now in termux builds, i.e. for Android which is a significant platform: Yes, it appears Android is going the FreeBSD x86 route. I.e., in theory it will have 32-bit time_t until 2038 and then will abruptly stop working. I

Re: behavioral change in coreutils `pwd` handling '//' (double slash) caused by gnulib update

2023-04-10 Thread Paul Eggert
On 2023-04-10 12:00, Zach van Rijn wrote: The gnulib commit that caused this behavioral change is: 356a414e8c15ef3f8cc7b7157427c8ce9a9f7c1b I'm not seeing any behavior change on Ubuntu, because building coreutils on Ubuntu doesn't need to compile lib/getcwd.c. That is, in your situation

Re: requiring 64-bit time_t again in coreutils; off_t too?

2023-04-10 Thread Paul Eggert
n Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 10 Apr 2023 11:55:54 -0700 Subject: [PATCH] doc: update re 32-bit builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * README-install: Mention how to build on 32-bit-only hosts. This builds on a pre

requiring 64-bit time_t again in coreutils; off_t too?

2023-04-09 Thread Paul Eggert
Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 9 Apr 2023 19:18:57 -0700 Subject: [PATCH] maint: require support for post-2038 timestamps * bootstrap.conf (gnulib_modules): Replace year2038 with year2038-required. --- NEWS | 5 + bootstrap.conf | 2 +- 2 files changed, 6 insertion

Re: nstrftime.c fails to build due to memset overflow

2023-03-15 Thread Paul Eggert
On 3/15/23 16:03, Marcus Müller wrote: introducing a macro really doesn't do readability I don't want the macro either. Let's just leave the code alone. I consider code paths that intentionally differ between debug and release builds There's no need for that. Debug with the same options you

Re: nstrftime.c fails to build due to memset overflow

2023-03-15 Thread Paul Eggert
On 3/15/23 02:41, Marcus Müller wrote: If my compiler doesn't optimize it away, well, then I have caused very little overhead. It's not really a question of overhead. Unecessary initializations make code harder to understand. Polluting code with unnecessary initializations together with comm

Re: nstrftime.c fails to build due to memset overflow

2023-03-14 Thread Paul Eggert
On 3/14/23 09:50, Pádraig Brady wrote: The attached also addresses -Wmaybe-initialized warnings in coreutils that show up at lower optimization levels. Let's not make that sort of change, please. It makes the code harder to read and analyze, because I look at the code and wonder, "why is this

switching from git: to https:

2023-02-04 Thread Paul Eggert
To allay concerns about adversary-in-the-middle attacks for people who build from Git, I installed the attached.From 407d8af1164de70fb02fce2eea01160de13a0feb Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 4 Feb 2023 11:53:50 -0800 Subject: [PATCH] maint: prefer https: to git: The idea is

Re: Possible non-compliance of the restrict keyword contract in coreutils/touch.c

2022-07-27 Thread Paul Eggert
timespec const *restrict); This is the usual pattern in the C standard and POSIX; see strptime, for example[1]. Any reason not to make this change to Gnulib? [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.htmlFrom 8260c414ca289a22463b020e773171e6da25044a Mon Sep 17

Re: [gnu.org #1845594] coreutils POC?

2022-06-16 Thread Paul Eggert
Thanks for the proposal. You've obviously spent some time writing it up. However, I'm not entirely sold on the idea being worth the effort. The point of the currently-supported approach is that one can and should communicate checksums by a different (and hopefully more reliable) means than what

[INSTALLED 4/5] maint: simplify comparisons

2022-05-17 Thread Paul Eggert
* src/comm.c (compare_files): * src/join.c (keycmp): * src/ls.c (off_cmp): * src/ptx.c (compare_words, compare_occurs): * src/set-fields.c (compare_ranges): Prefer ((a > b) - (a < b)) to variants like (a < b ? -1 : a > b) as it’s typically faster these days. --- src/comm.c | 5 ++--- src/joi

[INSTALLED 5/5] sort: fix unlikely int overflow with -r

2022-05-17 Thread Paul Eggert
* src/sort.c (keycompare, compare): Don’t overflow if -r is specified and a comparison function returns INT_MIN, as this causes the comparison to have undefined behavior (typically the reverse of correct). glibc memcmp on s390x reportedly returns INT_MIN in some cases, so this is not a purely acad

[INSTALLED 3/5] sort: remove some gotos

2022-05-17 Thread Paul Eggert
* src/sort.c (keycompare): Rework to avoid gotos. This also shrinks the machine code a bit (112 bytes) with GCC 12 x86-64 -O2. Nowadays compilers are smart enough to coalesce jumps so we need not do it by hand. --- src/sort.c | 55 +++--- 1 file cha

[INSTALLED 1/5] build: update gnulib submodule to latest

2022-05-17 Thread Paul Eggert
--- gnulib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnulib b/gnulib index 2ef6006ff..9cde39f88 16 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 2ef6006ffc4080cf8c0c1f4d4deeb4c357d7a695 +Subproject commit 9cde39f881204e422d4bdad67ab12877d6a8172d -- 2.36.1

[INSTALLED 2/5] sort: pacify GCC 12 false positive

2022-05-17 Thread Paul Eggert
* src/sort.c (keycompare): Rework to pacify a GCC 12 -Wmaybe-uninitialized false positive, by coalescing some minor duplicate code and eliminating a branch. This should execute an insn or two less in the usual case. --- src/sort.c | 40 +--- 1 file changed, 17

Re: coreutils-9.0.193-54bec on Solaris 11.4

2022-04-13 Thread Paul Eggert
On 4/12/22 17:51, Paul Eggert wrote: Your patch doesn't feel quite right to me but I haven't figured out why yet; I'll try to spring time to look at it in more detail. I did that installed the attached. Most of these are merely refactoring or minor tweaking; the 3rd patch is

Re: coreutils-9.0.193-54bec on Solaris 11.4

2022-04-12 Thread Paul Eggert
On 4/12/22 07:05, Pádraig Brady wrote: This does seem like a bug in that O_DIRECTORY should take precedence, especially considering O_SEARCH is documented in the Solaris open man page to return ENOTDIR for non directories. I don't think it's a bug, as longstanding POSIX tradition is that if th

Re: [PATCH] cp,mv,install: avoid opening destination non directories

2022-04-09 Thread Paul Eggert
On 4/9/22 11:38, Pádraig Brady wrote: The attached uses an extra stat() to avoid this hang, but only on these older systems without O_DIRECTORY. Thanks, good catch. I think you can simplify the system.h patch a bit, as there's no need for 'err' in this new code. Also, the "try an open a fifo

Re: [PATCH] fix descriptions for AT_NO_AUTOMOUNT

2022-03-10 Thread Paul Eggert
flag from the fstatat(2) man page. OK, thanks, I installed the attached to do that. From 51a5361a285783dd1bdc418bdad043069322d951 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 10 Mar 2022 13:07:53 -0800 Subject: [PATCH] fts: revert change to use AT_NO_AUTOMOUNT MIME-Version: 1.0 Content

Re: [PATCH] fix descriptions for AT_NO_AUTOMOUNT

2022-03-10 Thread Paul Eggert
On 3/10/22 05:46, Pádraig Brady wrote: After looking at the kernel code, it seems that:   fstatat() did _not_ imply AT_NO_AUTOMOUNT from 2.6.38 -> 4.11     I'm not sure it even honored the AT_NO_AUTOMOUNT flag before 4.11   fstatat() did imply AT_NO_AUTOMOUNT since 4.11 Ouch, so this whole t

Re: fstatat + AT_NO_AUTOMOUNT

2022-03-09 Thread Paul Eggert
due to the confusion already mentioned. I haven't audited Gnulib's uses of 'stat' and 'lstat'.From 44f347ce4009cd0100d0e6562939a032b16d6db1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 9 Mar 2022 11:54:13 -0800 Subject: [PATCH 1/2] fts: be consistent abou

Re: fstatat + AT_NO_AUTOMOUNT

2022-03-08 Thread Paul Eggert
On 3/8/22 04:29, Bernhard Voelker wrote: I'm not so sure about that: at least in container environment it seems to be common practice to mount regular files somewhere into the container, e.g.: Oh, I wasn't aware of that. However, don't they mount a regular file atop an already-existing regular

Re: fstatat + AT_NO_AUTOMOUNT

2022-03-07 Thread Paul Eggert
On 3/7/22 15:23, Pádraig Brady wrote: * I don't yet see any other use for AT_NO_AUTOMOUNT. Apart from the ls(1) and stat(1) cases previously mentioned I presume. I'll push those patches now. Yes, thanks.

Re: fstatat + AT_NO_AUTOMOUNT

2022-03-07 Thread Paul Eggert
On 3/7/22 13:56, Pádraig Brady wrote: $ git show 571f63f50 | grep -B3 fstatat Ah, I now see the problem: I suppressed some of GitHub's JavaScript code when looking at the URL you sent. I'll have to remember not to do that. After thinking about it a bit more, how about the following idea? *

Re: fstatat + AT_NO_AUTOMOUNT

2022-03-07 Thread Paul Eggert
On 3/7/22 09:33, Pádraig Brady wrote: On 07/03/2022 17:11, Paul Eggert wrote: On 3/7/22 07:02, Pádraig Brady wrote: When looking into https://bugs.gnu.org/54286 which discussed statx + AT_NO_AUTOMOUNT, I was wondering about the fstatat changes in https://github.com/coreutils/coreutils/commit

Re: fstatat + AT_NO_AUTOMOUNT

2022-03-07 Thread Paul Eggert
On 3/7/22 07:02, Pádraig Brady wrote: When looking into https://bugs.gnu.org/54286 which discussed statx + AT_NO_AUTOMOUNT, I was wondering about the fstatat changes in https://github.com/coreutils/coreutils/commit/571f63f50 and whether some of those should also specify AT_NO_AUTOMOUNT? I'm a b

[INSTALLED] cp: avoid unnecessary buffer allocation

2022-02-21 Thread Paul Eggert
Do not allocate I/O buffer if copy_file_range suffices. * src/copy.c (sparse_copy, lseek_copy): Buffer arg is now char ** instead of char *, and buffer is now allocated only if needed. All uses changed. --- src/copy.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) di

Re: Lint-related patches for coreutils

2022-01-31 Thread Paul Eggert
remember your suggestion to use 'maint:' a lot, though I admit I didn't quite get there with the attached patch batch.From 3a79d84f54e05cc15c152b9cf0e7a7ac4bfebf79 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 31 Jan 2022 19:52:43 -0800 Subject: [PATCH 1/5] df: fix memory l

Re: Lint-related patches for coreutils

2022-01-31 Thread Paul Eggert
On 1/31/22 13:48, Pádraig Brady wrote: src/expr.c: In function 'single_binary_main_expr': error: function might be candidate for attribute 'noreturn'   [-Werror=suggest-attribute=noreturn] note: in definition of macro 'main' Ouch. A simple fix is to disable that warning for single-binary buil

Lint-related patches for coreutils

2022-01-31 Thread Paul Eggert
me to eliminate a lot of 'IF_LINT (free (x))' calls. Comments and/or further fixes welcome of course.From ad4aa2a6f947967df883c18620517c53e67e19fc Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 31 Jan 2022 08:42:07 -0800 Subject: [PATCH 01/43] expr: lint cleanup, and introducin

'mv', 'install' now use openat etc. on destination directories

2022-01-29 Thread Paul Eggert
Following up on my recent 'cp' changes, I installed the attached so that 'mv' and 'install' are consistent with 'cp'. (I did a similar thing to 'ln' back in October 2018.)From 57c812cc3e17ecf5df887029221fe3f2d0cd7ea0 Mon Sep 17 00:00:00 2001

Having 'cat' use copy_file_range

2022-01-27 Thread Paul Eggert
t the ones having to do with page-aligned buffer allocation which is something cat does). I installed the attached series of patches to do all that; the last patch is the copy_file_range change. From 7410f5cd0956f60c82c9306a3e07d26a31b3a29b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 1

Compilations warnings-as-errors when building from git

2022-01-15 Thread Paul Eggert
In Assaf Gordon writes: I'm getting few warnings-as-errors when building the latest version from git (using Debian 10 amd64 with gcc 8.3.0). I wouldn't worry about these. We typically don't bother to pacify older GCC versions as they

Re: 'cp' now uses openat etc. when copying to directories

2022-01-15 Thread Paul Eggert
4d2573ff Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 15 Jan 2022 12:12:21 -0800 Subject: [PATCH] build: allow readlinkat calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem reported by Bernhard Voelker in: https://lists.gnu.org/r/cor

'cp' now uses openat etc. when copying to directories

2022-01-13 Thread Paul Eggert
oduced a bug. You'll also need to run ./bootstrap after doing a git pull, since some of the Gnulib changes are needed for this.From e2daa8f79781882f194e90dc49632ece1e1edf01 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 12 Jan 2022 10:57:32 -0800 Subject: [PATCH] cp: when copying to

new 'date' option --resolution and format %-N

2021-12-31 Thread Paul Eggert
subsecond fractions just wide enough to cover the resolution.From 6812e6baa7882ed064d274ead8dcd84b556603ce Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 31 Dec 2021 00:45:03 -0800 Subject: [PATCH 1/5] build: port to AIX 7.1 This fixes a porting bug introduced in 2019-08-12T03:29:00Z!br..

[PATCH] cp: clone on macOS

2021-11-21 Thread Paul Eggert
* configure.ac: Check for fclonefileat. * src/copy.c [HAVE_FCLONEFILEAT && !USE_XATTR]: Include . (copy_reg): If possible, use fclonefileat to clone. --- NEWS | 5 + configure.ac | 3 +++ src/copy.c | 12 3 files changed, 20 insertions(+) diff --git a/NEWS b/NEWS inde

[PATCH] cp: streamline cloning by skipping fstat

2021-11-21 Thread Paul Eggert
* src/copy.c (copy_reg): Attempt clone_file before fstat of dest, so that if clone_file succeeds we can skip the fstat. --- src/copy.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/copy.c b/src/copy.c index 9f20a34b9..97cc20d29 1006

[PATCH] maint: prefer MAYBE_UNUSED

2021-11-19 Thread Paul Eggert
Prefer MAYBE_UNUSED to _GL_UNUSED, since the C2x syntax will be [[maybe_unused]] at the start of the declaration, and we want to look forward to that. All uses of _GL_UNUSED either changed to MAYBE_UNUSED, or (when not needed) removed. --- src/chroot.c | 2 +- src/cksum.c | 3 +-- src/cksum.h

[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, src/m

[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 + gl/mod

[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 wi

[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 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. * gl/lib/randread.

[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 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] maint: modernize README-{hacking,prereq}

2021-10-30 Thread Paul Eggert
--- README-hacking | 60 +-- README-prereq | 96 +++--- 2 files changed, 70 insertions(+), 86 deletions(-) diff --git a/README-hacking b/README-hacking index be9ea3766..44cb75b98 100644 --- a/README-hacking +++ b/README-hack

[INSTALLED 1/2] tests: merge help-version changes back from gzip

2021-08-30 Thread Paul Eggert
* tests/misc/help-version.sh: Merge gzip-related changes back from gzip/tests/help-version. This fixes problems when TERM is not 'dumb', and should simplify maintenance. --- tests/misc/help-version.sh | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/misc/

[INSTALLED 2/2] tests: port better to NetBSD

2021-08-30 Thread Paul Eggert
* tests/misc/help-version.sh: Test that /dev/full causes shell printf to fail. This ports better to NetBSD 9.88.46, where it doesn’t. Problem reported by Nelson H. F. Beebe. --- tests/misc/help-version.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/misc/help-versi

[INSTALLED] basenc: prefer signed to unsigned integers

2021-08-27 Thread Paul Eggert
This patch modifies basenc to prefer signed integers to unsigned, as signed are less error-prone. This patch also updates Gnulib to to latest, which updates Gnulib’s base32 and base64 modules to prefer signed to unsigned integers. * src/basenc.c: Include idx.h. (struct base2_decode_context): Use un

[PATCH] build: update gnulib submodule to latest

2021-06-11 Thread Paul Eggert
Coreutils mistakenly did not list xstrndup as a module that it depends on directly. When the latest Gnulib removed the dirname module's dependency on xstrndup, this mistake caused coreutils to not build. Since all of Coreutils's uses of xstrndup know the string length, xmemdup0 is a better match

Re: [PATCH 0/1] Introduce sm3sum based on OSCCA SM3 hash

2021-05-28 Thread Paul Eggert
On 5/27/21 8:15 AM, Pádraig Brady wrote: I'm thinking rather than add yet another *sum util, we might go the route of a single utility with an option to select which algorithm to use. +1. This has long been something I wanted. We could simply overload 'cksum'

Re: Is the 'diacrit' module still needed?

2021-03-22 Thread Paul Eggert
On 3/22/21 4:19 PM, Bernhard Voelker wrote: BTW: what about a syntax-check rule to ensure we don't forget to sync files physically copied into 'coreutils.git', something (not much tested) like the following? I'll let Jim weigh in on that. Maybe it'd be better for 'bootstrap' to do the syncing.

Is the 'diacrit' module still needed?

2021-03-21 Thread Paul Eggert
Today I updated Coreutils to current Gnulib, and noticed that gnulib-tool warned that Gnulib's 'diacrit' module is obsolete. So I removed Coreutils's use of 'diacrit', as the only use was something obsolete in 'ptx'[1]. Does anyone else use 'diacrit'? If not, I suppose we can remove it from G

Re: [PATCH] selinux-h: add stubs for selabel_open etc.

2020-11-23 Thread Paul Eggert
On 11/23/20 1:15 AM, Kamil Dudka wrote: ...: context lookup failed: Operation not supported Thanks, I think I see the problem. I installed the attached to try to fix it. From e3a96eb14e8834f046d8370db80dfdc561ef5550 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 23 Nov 2020 01:48

Re: [PATCH] selinux-h: add stubs for selabel_open etc.

2020-11-23 Thread Paul Eggert
right now. Is there an SELinux crew at Red Hat that can look at coreutils as a sanity check? From 6ac67d13567f4ab10722c612d3ef05d0f2ad80ed Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 23 Nov 2020 00:52:00 -0800 Subject: [PATCH] maint: propagate errno better in selinux.c MIME-Version: 1.0

Re: [PATCH] selinux-h: add stubs for selabel_open etc.

2020-11-22 Thread Paul Eggert
On 11/22/20 10:59 AM, Bernhard Voelker wrote: selinux.c:257 has a superfluous semicolon after a jump label, and a strange indentation: The semicolon is required by the C standard, which does not allow a label before a declaration. Emacs indented it that way.

Re: [PATCH] selinux-h: add stubs for selabel_open etc.

2020-11-22 Thread Paul Eggert
On 11/22/20 6:27 AM, Bernhard Voelker wrote: This is caught by a syntax-check rule as well. Fixed with the attached patch - as well as 2 other sc failures. Thanks for fixing that. The tabs got introduced because I edited mv.c with an unusual Emacs configuration, which I'll try to remember to n

Re: [PATCH] selinux-h: add stubs for selabel_open etc.

2020-11-21 Thread Paul Eggert
doing a porting test of all this stuff). From 25f1b02d49a7117a3df502aa4f45e0dec0fc81a0 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 21 Nov 2020 12:59:09 -0800 Subject: [PATCH 1/3] build: update gnulib submodule to latest --- gnulib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

Re: parse-datetime.tab.h No such file or directory

2020-10-19 Thread Paul Eggert
hat we can see what options are sneaking in from the environment. >From c1babd86ac26aa718c78c41f05b271c8df6fcf5a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 19 Oct 2020 10:47:32 -0700 Subject: [PATCH] build: update gnulib submodule to latest * gl/lib/randperm.c, src/cp-hash.c, sr

Re: coreutils and GCC -fanalyzer

2020-07-10 Thread Paul Eggert
xpensive option. >From 6b6f0f54c0eca06345b7741e5fd37b4500675286 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 10 Jul 2020 15:54:51 -0700 Subject: [PATCH] build: be less aggressive about -fanalyzer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * c

Re: coreutils and GCC -fanalyzer

2020-07-01 Thread Paul Eggert
On 5/23/20 9:08 AM, Paul Eggert wrote: > So I am thinking of killing two > stones by doing the following. > > 1. Test for -fanalyzer, -Wall, -Wextra. > > 2. Test for flags not automatically enabled by -fanalyzer, -Wall, -Wextra but > flags that we want anyway. &

[PATCH] maint: use getrandom, not getentropy

2020-06-01 Thread Paul Eggert
This makes for one Gnulib module less, and at runtime there’s typically just one getrandom syscall instead of several for large nonces. * gl/lib/randread.c: Include sys/random.h instead of sys/time.h and unistd.h. (get_nonce): Use getrandom, not getentropy. * gl/modules/randread (Depends-on): Depen

bug#41622: [PATCH] tests: Change gnulib commit to compile make check

2020-05-31 Thread Paul Eggert
On 5/30/20 4:17 PM, Colton Lewis wrote: > When I ran make check after building the master branch commit > aefd434e, I got a compilation error. Thanks for reporting the problem. I updated the Gnulib version while fixing some other stuff, and am closing the bug report.

[PATCH 2/2] maint: use getentropy and new tempname modules

2020-05-31 Thread Paul Eggert
Update gnulib submodule to latest and use its new features. Gnulib’s new getentropy module means coreutils can now assume getentropy instead of approximating it, badly in some cases. Gnulib’s improvements to the tempname module mean coreutils no longer needs to maintain private patches. * bootstrap

[PATCH 1/2] echo: pacify Oracle Studio 12.6

2020-05-31 Thread Paul Eggert
* src/echo.c (main): Don’t assign pointer to bool. This is well-defined in C99, but is arguably bad style and Oracle Studio 12.6 complains. --- src/echo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/echo.c b/src/echo.c index b5a6e966c..e7f3447ee 100644 --- a/src/echo.c

Re: coreutils and GCC -fanalyzer

2020-05-23 Thread Paul Eggert
On 5/23/20 8:56 AM, Pádraig Brady wrote: > Note -Wanalyzer... flags are ineffective without -fanalyzer. > Also -Wanalyzer-too-complex (now auto enabled by gnulib) is currently quite > problematic with -fanalyzer. Hmm, that's odd, since I recall getting more warnings with those flags enabled. Perha

Re: coreutils and GCC -fanalyzer

2020-05-22 Thread Paul Eggert
On 5/21/20 4:23 PM, Pádraig Brady wrote: > I just use the default configure, which auto enables gcc warnings for git repo > builds, > and then build with: >   make CFLAGS="-march=native -std=gnu11 -g -O3 -fanalyzer" WERROR_CFLAGS= OK, so you're building with nonstandard warning options. In genera

Re: coreutils and GCC -fanalyzer

2020-05-21 Thread Paul Eggert
On 5/21/20 5:29 AM, Pádraig Brady wrote: The other pragmas are still needed though to suppress -fanalyzer warnings. I am not observing this with my copy of GCC 10.1.0. I am using GCC 10.1.0 without any Red-Hat-specific modifications, running on x86-64 (I built and ran it on RHEL 7.7). So I'

coreutils and GCC -fanalyzer

2020-05-20 Thread Paul Eggert
) and we don't want these bugs to adversely affect coreutils etc. >From e18efcfd0422b892ddd165035bad4f241591aa17 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 20 May 2020 16:40:26 -0700 Subject: [PATCH 1/2] maint: omit unnecessary pragmas and fix tsort.c * src/chown-core.c, sr

Re: parse-datetime.y - Military Timezones are inverted from the correct sense

2019-08-10 Thread Paul Eggert
Assaf Gordon wrote: Attached suggested follow-up patch for gnulib. Thanks for catching that; I installed it into Gnulib after updating the ChangeLog entry slightly (and commit message to match). The attached patch-set includes this fix, and the updated NEWS wording. (I'll wait until gnulib

Re: parse-datetime.y - Military Timezones are inverted from the correct sense

2019-08-10 Thread Paul Eggert
Assaf Gordon wrote: I suggest the attached patch for coreutils. OK, except I'd remove "in accordance with rfc5322" since RFC 5322 recommends treating all these zones as if they were UTC. Also, "T" continues to have its military meaning (i.e., between "S" and "U") if it's used properly.

Re: [PATCH] stat: don't explicitly request file size for filenames

2019-07-05 Thread Paul Eggert
ached patch instead? When the guessed size is zero it typically avoids a realloc by using a small stack buffer. >From d94bf537d7fdda13f4432bb60a98a8bd19d8e18d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 5 Jul 2019 16:48:22 -0700 Subject: [PATCH] areadlink-with-size: improve efficie

Re: [PATCH 1/2] printf,seq: improve long double accuracy

2019-01-30 Thread Paul Eggert
On 1/29/19 11:41 PM, Pádraig Brady wrote: strtold isn't generally available, which we already handle in sort.c for example. The attached fixes the build failure on systems like android. Bruno has a more general fix in gnulib, that makes strtold more consistent across all platforms, but we should

Re: A non TZ related question ...

2019-01-27 Thread Paul Eggert
Robert Elz wrote: That's when the suggestion was made that we should attempt to find out what other systems do. Most seem to be like linux (was?) and only allow '.' (posix actually mandates that for printf POSIX used to require that for printf, but now it requires the opposite, i.e., POSIX r

[PATCH 2/2] printf,seq: remove c-strtod dependency

2019-01-26 Thread Paul Eggert
* gl/modules/cl-strtold (Files): Add lib/cl-strtod.c, lib/cl-strtod.h. (Depends-on): Remove cl-strtod. (configure.ac): Redquire AC_C_RESTRICT. --- gl/modules/cl-strtold | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gl/modules/cl-strtold b/gl/modules/cl-strtold index 61cc43

[PATCH 1/2] printf,seq: improve long double accuracy

2019-01-26 Thread Paul Eggert
This fixes a thinko in the previous patch. * gl/lib/cl-strtod.c (STRTOD): New macro. (CL_STRTOD): Use it. --- gl/lib/cl-strtod.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gl/lib/cl-strtod.c b/gl/lib/cl-strtod.c index fa77235ba..dd6eef825 100644 --- a/gl/lib/cl-strtod.c

Re: A non TZ related question ...

2019-01-26 Thread Paul Eggert
ep' and similar coreutils programs to accept both syntaxes, by installing the attached patch into coreutils master. Perhaps NetBSD could do likewise. >From 4334001e3e9166242ac71bd7b9a8c04aaf9c8d36 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 26 Jan 2019 16:37:01 -0800 Subject:

[PATCH] printf,seq,sleep,tail,timeout: accept current-locale floats

2019-01-26 Thread Paul Eggert
of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +/* Written by Paul Eggert. */ + +#include + +#include "cl-strtod.h" + +#include + +#include +#include + +#if LONG +# define CL_STRTOD cl_strtold +# define DOUBLE

[PATCH] sleep: improve doc

2019-01-25 Thread Paul Eggert
Problem reported by Robert Elz. * doc/coreutils.texi (sleep invocation): Say that arguments must be non-negative, which means they cannot be arbitrary floating-point numbers. Mention POSIX, not “historical implementations” that are no longer of practical interest. List the extensions to POSIX. *

[PATCH] doc: update Goldberg URL

2019-01-25 Thread Paul Eggert
* doc/coreutils.texi (Floating point): Update URL. --- doc/coreutils.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index e9af80b7a..fa82d6546 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -1085,8 +1085,8 @@ has po

[INSTALLED 2/2] ln: use linkat and symlinkat

2018-10-28 Thread Paul Eggert
Open a target directory and use its file descriptor in linkat, symlinkat, etc. syscalls, instead of constructing long file names by concatenating the target directory name to a basename. This avoids O(N²) behavior with ‘ln F1 F2 ... Fn DIR’ when DIR is a long file name with many slashes. It also a

[INSTALLED 1/2] build: update gnulib submodule to latest

2018-10-28 Thread Paul Eggert
* src/copy.c (copy_internal): * src/cp.c (do_copy): * src/ln.c (do_link): Adjust to Gnulib API change. --- gnulib | 2 +- src/copy.c | 3 ++- src/cp.c | 2 +- src/ln.c | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gnulib b/gnulib index 1ff0e9684..ceeae5b03 16

[PATCH] build: update gnulib submodule to latest

2018-07-05 Thread Paul Eggert
* bootstrap.conf, src/copy.c, src/mv.c, src/shred.c: Adjust to renaming of renameat2 to renameatu. --- bootstrap.conf | 2 +- gnulib | 2 +- src/copy.c | 4 ++-- src/mv.c | 4 ++-- src/shred.c| 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bootstrap.c

Re: error: jump skips variable initialization

2018-06-25 Thread Paul Eggert
Bruno Haible wrote: Can someone answer this? I expect the warning is there because of style reasons, not correctness reasons. That is, although it's natural when seeing this line: int x = 10; to assume that X must always be initialized, this assumption is incorrect if a goto jumps over

[PATCH 2/3] maint: remove strpbrk module

2018-05-03 Thread Paul Eggert
* bootstrap.conf (gnulib_modules): Remove obsolete module strpbrk. --- bootstrap.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/bootstrap.conf b/bootstrap.conf index 48e93405c..8c2265f95 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -238,7 +238,6 @@ gnulib_modules=" strdup-posix

[PATCH 3/3] maint: port to GCC 8

2018-05-03 Thread Paul Eggert
* src/chown-core.h (chopt_free, gid_to_name, uid_to_name): No longer const. * src/make-prime-list.c (xalloc): Add malloc attribute. * src/who.c (make_id_equals_comment): Work around GCC bug 85602 by using mempcpy rather than strncat. Although the old code was correct, strncat raises so many hackle

[PATCH 1/3] build: update gnulib submodule to latest

2018-05-03 Thread Paul Eggert
--- gnulib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnulib b/gnulib index 59e59d99b..81acba941 16 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 59e59d99bc1ca635d178778b9b4ee544330775c4 +Subproject commit 81acba941a158525a3a8b976cb74e59c8cde1b74 -- 2.17.0

[PATCH] cp: remove ASSIGN_BASENAME_STRDUPA

2018-01-05 Thread Paul Eggert
* src/cp.c (do_copy): Just use ASSIGN_STRDUPA, as this simplifies the code and uses less memory. --- src/cp.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/cp.c b/src/cp.c index d81d41859..04ceb8687 100644 --- a/src/cp.c +++ b/src/cp.c @@ -40,16 +40,6 @@

  1   2   3   >