[PATCH 3/3] tests: prefer stdckdint to intprops

2022-10-10 Thread Paul Eggert
* modules/chown-tests, modules/fchownat-tests:
* modules/fdutimensat-tests, modules/futimens-tests:
* modules/lchown-tests, modules/stat-time-tests:
* modules/utime-tests, modules/utimens-tests:
* modules/utimensat-tests:
(Depends on): Depend on stdckint, not intprops.
* tests/nap.h: Include stdckdint.h, not intprops.h.
All macro uses changed.
---
 ChangeLog | 10 ++
 modules/chown-tests   |  2 +-
 modules/fchownat-tests|  2 +-
 modules/fdutimensat-tests |  2 +-
 modules/futimens-tests|  2 +-
 modules/lchown-tests  |  2 +-
 modules/stat-time-tests   |  2 +-
 modules/utime-tests   |  2 +-
 modules/utimens-tests |  2 +-
 modules/utimensat-tests   |  2 +-
 tests/nap.h   |  8 
 11 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0827f5c772..8abee26d10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2022-10-10  Paul Eggert  
 
+   tests: prefer stdckdint to intprops
+   * modules/chown-tests, modules/fchownat-tests:
+   * modules/fdutimensat-tests, modules/futimens-tests:
+   * modules/lchown-tests, modules/stat-time-tests:
+   * modules/utime-tests, modules/utimens-tests:
+   * modules/utimensat-tests:
+   (Depends on): Depend on stdckint, not intprops.
+   * tests/nap.h: Include stdckdint.h, not intprops.h.
+   All macro uses changed.
+
stat-time: prefer stdckdint to intprops
* lib/stat-time.h: Include stdckdint.h instead of intprops.h.
(stat_time_normalize): Use ckd_add instead of INT_ADD_WRAPV.
diff --git a/modules/chown-tests b/modules/chown-tests
index 13138f438b..1bd6744067 100644
--- a/modules/chown-tests
+++ b/modules/chown-tests
@@ -7,12 +7,12 @@ tests/macros.h
 
 Depends-on:
 ignore-value
-intprops
 lstat
 mgetgroups
 nanosleep
 stat-time
 stdbool
+stdckdint
 symlink
 
 configure.ac:
diff --git a/modules/fchownat-tests b/modules/fchownat-tests
index e5fb7833f4..f0e4cea78c 100644
--- a/modules/fchownat-tests
+++ b/modules/fchownat-tests
@@ -9,11 +9,11 @@ tests/macros.h
 Depends-on:
 errno
 ignore-value
-intprops
 mgetgroups
 nanosleep
 openat-h
 stat-time
+stdckdint
 symlink
 
 configure.ac:
diff --git a/modules/fdutimensat-tests b/modules/fdutimensat-tests
index 37f70c6528..1f492a6989 100644
--- a/modules/fdutimensat-tests
+++ b/modules/fdutimensat-tests
@@ -10,9 +10,9 @@ tests/macros.h
 Depends-on:
 fcntl-h
 ignore-value
-intprops
 nanosleep
 openat
+stdckdint
 timespec
 dup
 utimecmp
diff --git a/modules/futimens-tests b/modules/futimens-tests
index 5191413007..636f8426b6 100644
--- a/modules/futimens-tests
+++ b/modules/futimens-tests
@@ -10,8 +10,8 @@ Depends-on:
 gettext-h
 fcntl-h
 ignore-value
-intprops
 nanosleep
+stdckdint
 timespec
 dup
 utimecmp
diff --git a/modules/lchown-tests b/modules/lchown-tests
index 42b946014c..edd0cc7c21 100644
--- a/modules/lchown-tests
+++ b/modules/lchown-tests
@@ -8,9 +8,9 @@ tests/macros.h
 Depends-on:
 errno
 ignore-value
-intprops
 mgetgroups
 nanosleep
+stdckdint
 stat-time
 stdbool
 symlink
diff --git a/modules/stat-time-tests b/modules/stat-time-tests
index 8db2369513..9fafb9fb9a 100644
--- a/modules/stat-time-tests
+++ b/modules/stat-time-tests
@@ -4,8 +4,8 @@ tests/macros.h
 tests/nap.h
 
 Depends-on:
-intprops
 nanosleep
+stdckdint
 time
 unistd
 
diff --git a/modules/utime-tests b/modules/utime-tests
index a64d0a0069..3f30f92925 100644
--- a/modules/utime-tests
+++ b/modules/utime-tests
@@ -8,8 +8,8 @@ Depends-on:
 dup
 gettext-h
 ignore-value
-intprops
 nanosleep
+stdckdint
 symlink
 timespec
 utimecmp
diff --git a/modules/utimens-tests b/modules/utimens-tests
index 2a95346a0d..b3e066f95f 100644
--- a/modules/utimens-tests
+++ b/modules/utimens-tests
@@ -11,8 +11,8 @@ Depends-on:
 dup
 gettext-h
 ignore-value
-intprops
 nanosleep
+stdckdint
 symlink
 timespec
 utimecmp
diff --git a/modules/utimensat-tests b/modules/utimensat-tests
index 15c79407e8..d713b7052c 100644
--- a/modules/utimensat-tests
+++ b/modules/utimensat-tests
@@ -9,8 +9,8 @@ tests/macros.h
 
 Depends-on:
 ignore-value
-intprops
 nanosleep
+stdckdint
 timespec
 utimecmp
 
diff --git a/tests/nap.h b/tests/nap.h
index 1320d2f8f8..37f8009c6d 100644
--- a/tests/nap.h
+++ b/tests/nap.h
@@ -21,7 +21,7 @@
 
 # include 
 
-# include 
+# include 
 
 /* Avoid a conflict with a function called nap() on UnixWare.  */
 # if defined _SCO_DS || (defined __SCO_VERSION__ || defined __sysv5__)  /* 
OpenServer, UnixWare */
@@ -54,9 +54,9 @@ diff_timespec (struct timespec a, struct timespec b)
   if (! (bs < as || (bs == as && bns < ans)))
 return 0;
 
-  if (INT_SUBTRACT_WRAPV (as, bs, )
-  || INT_MULTIPLY_WRAPV (sdiff, 10, )
-  || INT_ADD_WRAPV (sdiff, ans - bns, ))
+  if (ckd_sub (, as, bs)
+  || ckd_mul (, sdiff, 10)
+  || ckd_add (, sdiff, ans - bns))
 return INT_MAX;
 
   return sdiff;
-- 
2.37.3




[PATCH 2/3] stat-time: prefer stdckdint to intprops

2022-10-10 Thread Paul Eggert
* lib/stat-time.h: Include stdckdint.h instead of intprops.h.
(stat_time_normalize): Use ckd_add instead of INT_ADD_WRAPV.
* modules/stat-time (Depends-on): Depend on stdckdint, not intprops.
---
 ChangeLog | 5 +
 lib/stat-time.h   | 5 ++---
 modules/stat-time | 2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c918d0e45e..0827f5c772 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2022-10-10  Paul Eggert  
 
+   stat-time: prefer stdckdint to intprops
+   * lib/stat-time.h: Include stdckdint.h instead of intprops.h.
+   (stat_time_normalize): Use ckd_add instead of INT_ADD_WRAPV.
+   * modules/stat-time (Depends-on): Depend on stdckdint, not intprops.
+
xalloc: remove stray includes + dependencies
These used to be needed, but are not needed now.
* lib/xalloc.h: Do not include stdlib.h.
diff --git a/lib/stat-time.h b/lib/stat-time.h
index 6b0088e328..b661196ea5 100644
--- a/lib/stat-time.h
+++ b/lib/stat-time.h
@@ -20,9 +20,8 @@
 #ifndef STAT_TIME_H
 #define STAT_TIME_H 1
 
-#include "intprops.h"
-
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -232,7 +231,7 @@ stat_time_normalize (int result, _GL_UNUSED struct stat *st)
   /* Overflow is possible, as Solaris 11 stat can yield
  tv_sec == TYPE_MINIMUM (time_t) && tv_nsec == -10.
  INT_ADD_WRAPV is OK, since time_t is signed on Solaris.  */
-  if (INT_ADD_WRAPV (q, ts->tv_sec, >tv_sec))
+  if (ckd_add (>tv_sec, q, ts->tv_sec))
 {
   errno = EOVERFLOW;
   return -1;
diff --git a/modules/stat-time b/modules/stat-time
index 2f137fc25d..92120ace8c 100644
--- a/modules/stat-time
+++ b/modules/stat-time
@@ -11,7 +11,7 @@ time
 errno
 extensions
 extern-inline
-intprops
+stdckdint
 
 configure.ac:
 gl_STAT_TIME
-- 
2.37.3




[PATCH 1/3] xalloc: remove stray includes + dependencies

2022-10-10 Thread Paul Eggert
These used to be needed, but are not needed now.
* lib/xalloc.h: Do not include stdlib.h.
[GNULIB_XALLOC]: Do not include "intprops.h".
* lib/xmalloc.c: Include stdint.h here instead, for SIZE_MAX.
* modules/xalloc-die, modules/xvasprintf (Depends-on): Remove stdint.
---
 ChangeLog  | 9 +
 lib/xalloc.h   | 2 --
 lib/xmalloc.c  | 1 +
 modules/xalloc-die | 1 -
 modules/xvasprintf | 1 -
 5 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 74b496ddee..c918d0e45e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-10-10  Paul Eggert  
+
+   xalloc: remove stray includes + dependencies
+   These used to be needed, but are not needed now.
+   * lib/xalloc.h: Do not include stdlib.h.
+   [GNULIB_XALLOC]: Do not include "intprops.h".
+   * lib/xmalloc.c: Include stdint.h here instead, for SIZE_MAX.
+   * modules/xalloc-die, modules/xvasprintf (Depends-on): Remove stdint.
+
 2022-09-30  Paul Eggert  
 
assert-h: suppress Apple clang 13 false alarms
diff --git a/lib/xalloc.h b/lib/xalloc.h
index 9f4bf8d454..01a9eec8da 100644
--- a/lib/xalloc.h
+++ b/lib/xalloc.h
@@ -20,11 +20,9 @@
 
 #include 
 #include 
-#include 
 
 #if GNULIB_XALLOC
 # include "idx.h"
-# include "intprops.h"
 #endif
 
 #ifndef _GL_INLINE_HEADER_BEGIN
diff --git a/lib/xmalloc.c b/lib/xmalloc.c
index 3c3cb20799..84cdf1f2fd 100644
--- a/lib/xmalloc.c
+++ b/lib/xmalloc.c
@@ -26,6 +26,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 static void * _GL_ATTRIBUTE_PURE
diff --git a/modules/xalloc-die b/modules/xalloc-die
index e8ef52abe8..177b68eb2e 100644
--- a/modules/xalloc-die
+++ b/modules/xalloc-die
@@ -10,7 +10,6 @@ error
 extern-inline
 gettext-h
 exitfail
-stdint
 
 configure.ac:
 gl_MODULE_INDICATOR([xalloc-die])
diff --git a/modules/xvasprintf b/modules/xvasprintf
index ae233148d3..4ebbba470a 100644
--- a/modules/xvasprintf
+++ b/modules/xvasprintf
@@ -15,7 +15,6 @@ xalloc
 xalloc-die
 xsize
 stdarg
-stdint
 errno
 
 configure.ac:
-- 
2.37.3




Re: "git-version-gen" prints "Print a version string." three times

2022-10-10 Thread Simon Josefsson via Gnulib discussion list
Bjarni Ingi Gislason  writes:

> "sh -x build-aux/get-version-gen" outputs:

I don't think that's a bug -- running the script under 'sh -x' is not a
supported by of invoking it, but a way to invoke shell debugging of the
script.  I don't see anything unexpected in the debug output, it doesn't
print the help string three times, it is merely shown in debug output.
Redirect debug output with 2>/dev/null and you will only see what the
script prints.  Running 'build-aux/get-version-gen' works fine as
expected.

/Simon

> + scriptversion=2022-07-09.08
> + me=build-aux/git-version-gen
> + expr 2022-07-09.08 : \([^-]*\)
> + year=2022
> + version=git-version-gen 2022-07-09.08
>
> Copyright (C) 2022 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later 
> .
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> + usage=Usage: build-aux/git-version-gen [OPTION]... $srcdir/.tarball-version 
> [TAG-NORMALIZATION-SED-SCRIPT]
> Print a version string.
>
> Options:
>
>--prefix PREFIXprefix of git tags (default 'v')
>--fallback VERSION
>   fallback version to use if "git --version" fails
>
>--help display this help and exit
>--version  output version information and exit
>
> Send patches and bug reports to .
> + prefix=v
> + fallback=
> + test 0 -gt 0
> + test x = x
> + echo Usage: build-aux/git-version-gen [OPTION]... $srcdir/.tarball-version 
> [TAG-NORMALIZATION-SED-SCRIPT]
> Print a version string.
>
> Options:
>
>--prefix PREFIXprefix of git tags (default 'v')
>--fallback VERSION
>   fallback version to use if "git --version" fails
>
>--help display this help and exit
>--version  output version information and exit
>
> Send patches and bug reports to .
> Usage: build-aux/git-version-gen [OPTION]... $srcdir/.tarball-version 
> [TAG-NORMALIZATION-SED-SCRIPT]
> Print a version string.
>
> Options:
>
>--prefix PREFIXprefix of git tags (default 'v')
>--fallback VERSION
>   fallback version to use if "git --version" fails
>
>--help display this help and exit
>--version  output version information and exit
>
> Send patches and bug reports to .
> + exit 1
>
>


signature.asc
Description: PGP signature