]> Savannah Git Hosting - gnulib.git/log
gnulib.git
4 years agoUse module 'c99' when needed for subobject initializer syntax.
Bruno Haible [Sat, 5 Sep 2020 17:56:55 +0000 (19:56 +0200)]
Use module 'c99' when needed for subobject initializer syntax.

* modules/tempname (Depends-on): Add c99.
* modules/nstrftime-tests (Depends-on): Likewise.

4 years agoUse module 'c99' when needed for declaration-after-statement syntax.
Bruno Haible [Sat, 5 Sep 2020 16:35:24 +0000 (18:35 +0200)]
Use module 'c99' when needed for declaration-after-statement syntax.

* modules/backup-rename (Depends-on): Add c99.
* modules/backupfile (Depends-on): Likewise.
* modules/bitset-tests (Depends-on): Likewise.
* modules/bitsetv (Depends-on): Likewise.
* modules/c-strtod (Depends-on): Likewise.
* modules/c-strtold (Depends-on): Likewise.
* modules/clean-temp (Depends-on): Likewise.
* modules/copy-file (Depends-on): Likewise.
* modules/crypto/hmac-md5-tests (Depends-on): Likewise.
* modules/crypto/hmac-sha1-tests (Depends-on): Likewise.
* modules/crypto/hmac-sha256-tests (Depends-on): Likewise.
* modules/crypto/hmac-sha512-tests (Depends-on): Likewise.
* modules/crypto/md5-buffer (Depends-on): Likewise.
* modules/crypto/md5-tests (Depends-on): Likewise.
* modules/crypto/sha1-buffer (Depends-on): Likewise.
* modules/crypto/sha1-tests (Depends-on): Likewise.
* modules/crypto/sha256-buffer (Depends-on): Likewise.
* modules/crypto/sha256-tests (Depends-on): Likewise.
* modules/crypto/sha512-buffer (Depends-on): Likewise.
* modules/crypto/sha512-tests (Depends-on): Likewise.
* modules/diffseq (Depends-on): Likewise.
* modules/fatal-signal (Depends-on): Likewise.
* modules/fchmodat (Depends-on): Likewise.
* modules/fstrcmp (Depends-on): Likewise.
* modules/fsusage (Depends-on): Likewise.
* modules/fts (Depends-on): Likewise.
* modules/fts-tests (Depends-on): Likewise.
* modules/getumask (Depends-on): Likewise.
* modules/git-merge-changelog (Depends-on): Likewise.
* modules/hash-map (Depends-on): Likewise.
* modules/hash-set (Depends-on): Likewise.
* modules/lchmod (Depends-on): Likewise.
* modules/libgmp-tests (Depends-on): Likewise.
* modules/libtextstyle-optional-tests (Depends-on): Likewise.
* modules/linkedhash-map (Depends-on): Likewise.
* modules/linkedhash-set (Depends-on): Likewise.
* modules/long-options (Depends-on): Likewise.
* modules/mbrtoc32 (Depends-on): Likewise.
* modules/memchr2-tests (Depends-on): Likewise.
* modules/memmem-tests (Depends-on): Likewise.
* modules/memrchr-tests (Depends-on): Likewise.
* modules/mktime-internal (Depends-on): Likewise.
* modules/nstrftime (Depends-on): Likewise.
* modules/opendirat (Depends-on): Likewise.
* modules/parse-datetime (Depends-on): Likewise.
* modules/quotearg-simple-tests (Depends-on): Likewise.
* modules/same (Depends-on): Likewise.
* modules/supersede (Depends-on): Likewise.
* modules/supersede-tests (Depends-on): Likewise.
* modules/time_rz (Depends-on): Likewise.
* modules/unistr/u16-chr-tests (Depends-on): Likewise.
* modules/unistr/u32-chr-tests (Depends-on): Likewise.
* modules/unistr/u8-chr-tests (Depends-on): Likewise.
* modules/xalloc (Depends-on): Likewise.
* modules/xnanosleep (Depends-on): Likewise.

4 years agoFix "warning: array initialized from parenthesized string constant".
Bruno Haible [Sat, 5 Sep 2020 14:58:11 +0000 (16:58 +0200)]
Fix "warning: array initialized from parenthesized string constant".

* tests/test-memmem.c (main): Remove parentheses around string constant.
* tests/test-c-strcasestr.c (main): Likewise.
* tests/test-strcasestr.c (main): Likewise.

4 years agoargmatch tests: Fix ISO C compliance warning.
Bruno Haible [Sat, 5 Sep 2020 14:42:06 +0000 (16:42 +0200)]
argmatch tests: Fix ISO C compliance warning.

* tests/test-argmatch.c: Omit semicolon after ARGMATCH_DEFINE_GROUP
invocation.

4 years agouniname/uniname: Fix -Wshadow warning.
Bruno Haible [Sat, 5 Sep 2020 12:26:49 +0000 (14:26 +0200)]
uniname/uniname: Fix -Wshadow warning.

* lib/uniname/uniname.c (unicode_name_word): Don't declare i upfront.
* modules/uniname/uniname (Depends-on): Add c99.

4 years agouniname/uniname: Fix -Wshorten-64-to-32 warnings.
Bruno Haible [Sat, 5 Sep 2020 13:44:29 +0000 (15:44 +0200)]
uniname/uniname: Fix -Wshorten-64-to-32 warnings.

* lib/uniname/uniname.c (unicode_name_word_lookup): Change type of last
argument to size_t.
(unicode_name_character): Change type of len, n1, n2, n3, words_length,
n to size_t.

4 years agounistr/u{8,16,32}-uctomb: Avoid possible trouble with huge strings.
Bruno Haible [Sat, 5 Sep 2020 13:24:53 +0000 (15:24 +0200)]
unistr/u{8,16,32}-uctomb: Avoid possible trouble with huge strings.

* lib/unistr.in.h (u8_uctomb_aux, u8_uctomb, u16_uctomb_aux, u16_uctomb,
u32_uctomb): Change type of last argument to ptrdiff_t.
* lib/unistr/u8-uctomb.c (u8_uctomb): Likewise.
* lib/unistr/u8-uctomb-aux.c (u8_uctomb_aux): Likewise.
* lib/unistr/u16-uctomb.c (u16_uctomb): Likewise.
* lib/unistr/u16-uctomb-aux.c (u16_uctomb_aux): Likewise.
* lib/unistr/u32-uctomb.c (u32_uctomb): Likewise.

4 years agomanywarnings: remove -Wchkp and -Wabi from C++ too
Paul Eggert [Tue, 1 Sep 2020 18:14:33 +0000 (11:14 -0700)]
manywarnings: remove -Wchkp and -Wabi from C++ too

Suggested by Reuben Thomas in:
https://lists.gnu.org/r/bug-gnulib/2020-09/msg00001.html
At some point somebody should merge the many other manywarnings-c.m4
changes into manywarnings-c++.m4 too, e.g.,
2020-07-02T00:00:51Z!eggert@cs.ucla.edu.
* m4/manywarnings-c++.m4 (gl_MANYWARN_ALL_GCC_CXX_IMPL):
Remove -Wchkp, -Wabi.

4 years agostrerrorname_np: Add tests.
Bruno Haible [Sun, 30 Aug 2020 20:20:01 +0000 (22:20 +0200)]
strerrorname_np: Add tests.

* tests/test-strerrorname_np.c: New file.
* modules/strerrorname_np-tests: New file.

4 years agostrerrorname_np: New module.
Bruno Haible [Sun, 30 Aug 2020 20:19:05 +0000 (22:19 +0200)]
strerrorname_np: New module.

* lib/string.in.h (strerrorname_np): New declaration.
* lib/strerrorname_np.c: New file.
* m4/strerrorname_np.m4: New file.
* m4/string_h.m4 (gl_HEADER_STRING_H_BODY): Test whether strerrorname_np
is declared.
(gl_HEADER_STRING_H_DEFAULTS): Initialize GNULIB_STRERRORNAME_NP,
HAVE_STRERRORNAME_NP, REPLACE_STRERRORNAME_NP.
* modules/string (Makefile.am): Substitute GNULIB_STRERRORNAME_NP,
HAVE_STRERRORNAME_NP, REPLACE_STRERRORNAME_NP.
* modules/strerrorname_np: New file.
* tests/test-string-c++.cc: Verify the signature of strerrorname_np.
* doc/glibc-functions/strerrorname_np.texi: Mention the new module and
the glibc 2.32 bug.

4 years agoperror, strerror_r: remove unportable tests
Paul Eggert [Fri, 28 Aug 2020 00:52:58 +0000 (17:52 -0700)]
perror, strerror_r: remove unportable tests

Problem reported by Florian Weimer in:
https://lists.gnu.org/r/bug-gnulib/2020-08/msg00220.html
* tests/test-perror2.c (main):
* tests/test-strerror_r.c (main): Omit unportable tests.

4 years agostdint, wchar, wctype-h: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 23:27:21 +0000 (01:27 +0200)]
stdint, wchar, wctype-h: Change configure message.

* m4/wint_t.m4 (gt_TYPE_WINT_T): Say "checking whether wint_t is large
enough..." instead of "checking whether wint_t is too small...".

4 years agotime_rz: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 23:23:55 +0000 (01:23 +0200)]
time_rz: Change configure message.

* m4/time_rz.m4 (gl_TIME_RZ): Say "checking whether localtime works even
near extrema..." instead of "checking whether localtime loops forever
near extrema...".

4 years agostdint: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 23:21:27 +0000 (01:21 +0200)]
stdint: Change configure message.

* m4/stdint.m4 (gl_STDINT_H): Say "checking whether stdint.h works
without ISO C predefines..." instead of "checking whether stdint.h
predates C++11...".

4 years agosocketlib: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 23:09:20 +0000 (01:09 +0200)]
socketlib: Change configure message.

* m4/socketlib.m4 (gl_SOCKETLIB): Say "checking for WSAStartup..."
instead of "checking if we need to call WSAStartup in winsock2.h and
-lws2_32...".

4 years agoinclude_next: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 23:04:36 +0000 (01:04 +0200)]
include_next: Change configure message.

* m4/include_next.m4 (gl_INCLUDE_NEXT): Say "checking whether source
code line length is unlimited..." instead of "checking whether system
header files limit the line length...".

4 years agogetcwd: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 22:56:09 +0000 (00:56 +0200)]
getcwd: Change configure message.

* m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Say "checking
whether getcwd succeeds when 4k < cwd_length < 16k..." instead of
"checking whether getcwd aborts when 4k < cwd_length < 16k...".

4 years agochdir-long: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 22:49:28 +0000 (00:49 +0200)]
chdir-long: Change configure message.

* m4/chdir-long.m4 (gl_FUNC_CHDIR_LONG): Say "checking whether this
system supports file names of any length..." instead of "checking
whether this system has an arbitrary file name length limit...".
Set gl_cv_have_unlimited_file_name_length instead of
gl_cv_have_arbitrary_file_name_length_limit.
* modules/chdir-long (Depends-on, configure.ac): Update accordingly.

4 years agoceill: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 22:47:22 +0000 (00:47 +0200)]
ceill: Change configure message.

* m4/ceill.m4 (gl_FUNC_CEILL): Say "checking whether ceill() works..."
instead of "checking whether ceill() breaks with small values...".

4 years agoiconv: Change configure message.
Bruno Haible [Wed, 26 Aug 2020 22:42:22 +0000 (00:42 +0200)]
iconv: Change configure message.

* m4/iconv.m4 (AM_ICONV): Say "checking whether iconv is compatible
with its POSIX signature..." instead of "checking for iconv
declaration...". Remove K&R C support.

4 years ago* ChangeLog: Fix stray paren.
Paul Eggert [Wed, 26 Aug 2020 22:56:02 +0000 (15:56 -0700)]
* ChangeLog: Fix stray paren.

4 years agogetcwd: help the merge back into glibc
Paul Eggert [Wed, 26 Aug 2020 22:30:53 +0000 (15:30 -0700)]
getcwd: help the merge back into glibc

This patch was inspired by Adhemerval Zanella’s proposed glibc patches:
https://sourceware.org/pipermail/libc-alpha/2020-August/117294.html
The idea is to make it easier for Gnulib lib/getcwd.c to match
glibc io/getcwd-generic.c.
* lib/getcwd.c [_LIBC]: Do not include pathmax.h.
Include not-cancel.h.
(HAVE_OPENAT, D_INO_IN_DIRENT, HAVE_MSVC_INVALID_PARAMETER_HANDLER)
(HAVE_MINIMALLY_WORKING_GETCWD): Define for the _LIBC case.
(__getcwd, __lstat, __readdir) [!_LIBC]: Remove these macros.
(__close_nocancel_nostatus, __getcwd_generic, stat64, __fstat64)
(__fstatat64, __lstat64, __readdir64, __fdopendir, __openat)
(__rewinddir, __openat64, dirent64) [_LIBC]: New macros.
(__getcwd_generic): Rename from __getcwd.
Use the abovementioned macros for consistency with glibc.
(weak_alias): Remove.

4 years agoverify: Avoid warnings when assume(0) is used.
Bruno Haible [Tue, 25 Aug 2020 23:45:49 +0000 (01:45 +0200)]
verify: Avoid warnings when assume(0) is used.

Reported by Mattias Engdegård <mattiase@acm.org> via Paul Eggert in
<https://lists.gnu.org/archive/html/emacs-devel/2020-08/msg00838.html>.

* lib/verify.h (assume): Use __builtin_unreachable if the argument is
the constant 0.
* tests/test-verify.c (f): New function.
(state): New type.
(test_assume_expressions, test_assume_optimization,
test_assume_noreturn): New functions.

4 years agofstrcmp: Clarification regarding NOTE_ORDERED.
Bruno Haible [Tue, 25 Aug 2020 22:29:28 +0000 (00:29 +0200)]
fstrcmp: Clarification regarding NOTE_ORDERED.

* lib/fstrcmp.c (NOTE_ORDERED): Define to false.

4 years agodiffseq: new option NOTE_ORDERED
Paul Eggert [Mon, 24 Aug 2020 22:19:27 +0000 (15:19 -0700)]
diffseq: new option NOTE_ORDERED

Problem reported by Phil Sainty <https://bugs.gnu.org/42931>.
* NEWS: Mention this.
* lib/diffseq.h (NOTE_ORDERED): New macro.
(IF_LINT2): Remove; no longer needed.
(compareseq): If (!NOTE_ORDERED), recurse on the smaller
subproblem and iterate to do the larger.

4 years agoautoupdate
Karl Berry [Mon, 24 Aug 2020 14:24:52 +0000 (07:24 -0700)]
autoupdate

4 years agosys_types: let Autoconf 2.70 do pid_t
Paul Eggert [Mon, 24 Aug 2020 02:36:10 +0000 (19:36 -0700)]
sys_types: let Autoconf 2.70 do pid_t

* m4/pid_t.m4 (AC_TYPE_PID_T): Redefine this Autoconf macro
only for Autoconf versions 2.69 and earlier, since 2.70
will be fixed.

4 years agotests: Don't assume that pid_t fits in an 'int'.
Bruno Haible [Sun, 23 Aug 2020 23:22:49 +0000 (01:22 +0200)]
tests: Don't assume that pid_t fits in an 'int'.

* tests/test-nonblocking-pipe-main.c (main): Use type 'pid_t' instead
of 'int'.
* tests/test-nonblocking-socket-main.c (main): Likewise.

4 years agosys_types: Fix definition of pid_t on 64-bit MSVC.
Bruno Haible [Sun, 23 Aug 2020 23:19:18 +0000 (01:19 +0200)]
sys_types: Fix definition of pid_t on 64-bit MSVC.

* m4/pid_t.m4: New file.
* modules/sys_types (Files): Add it.
* modules/dirent (Files): Likewise.
* modules/fcntl-h (Files): Likewise.
* modules/sched (Files): Likewise.
* modules/signal-h (Files): Likewise.
* modules/spawn (Files): Likewise.
* modules/sys_stat (Files): Likewise.
* modules/sys_wait (Files): Likewise.
* modules/termios (Files): Likewise.
* modules/unistd (Files): Likewise.

4 years agointtypes: Fix {PRI,SCN}*PTR on 32-bit native Windows (regr. 2020-07-21).
Bruno Haible [Sun, 23 Aug 2020 22:29:41 +0000 (00:29 +0200)]
inttypes: Fix {PRI,SCN}*PTR on 32-bit native Windows (regr. 2020-07-21).

* m4/inttypes.m4 (gl_INTTYPES_PRI_SCN): Fix syntax error in test
program.

4 years agointprops: be consistent about +X vs X+0
Paul Eggert [Sun, 23 Aug 2020 20:14:14 +0000 (13:14 -0700)]
intprops: be consistent about +X vs X+0

* lib/intprops.h (_GL_SIGNED_INT_MAXIMUM): Simplify.

4 years agointprops: fix INT_MULTIPLY_WRAPV bit-field bug
Paul Eggert [Sun, 23 Aug 2020 20:14:13 +0000 (13:14 -0700)]
intprops: fix INT_MULTIPLY_WRAPV bit-field bug

The bug occurs when using INT_MULTIPLY_WRAPV (a, b, c) where B
is a bit-field, on older GCC or non-GCC compilers where we do
things ourselves instead of using __builtin_mul_overflow.
Without this fix, INT_MULTIPLY_WRAPV would not compile, due
to applying sizeof to a bit-field.
* lib/intprops.h (_GL_INT_MULTIPLY_RANGE_OVERFLOW):
Promote B before giving it to TYPE_WIDTH, in case B is a bit-field.

4 years agosupersede: Avoid a failure when writing to /dev/null in Solaris zones.
Bruno Haible [Sun, 23 Aug 2020 17:37:17 +0000 (19:37 +0200)]
supersede: Avoid a failure when writing to /dev/null in Solaris zones.

Reported by Jörg Sonnenberger <joerg@netbsd.org>
via Thomas Klausner <tk@giga.or.at> in
<https://pkgsrc.se/files.php?messageId=20200812233110.30230FB28@cvs.NetBSD.org>.

* lib/supersede.c (open_supersede): When opening an existing non-regular
file on Solaris, use O_CREAT although it should not be necessary.

4 years agoverify: Make assume work on bit field expressions (regr. 2020-08-22).
Bruno Haible [Sun, 23 Aug 2020 14:24:55 +0000 (16:24 +0200)]
verify: Make assume work on bit field expressions (regr. 2020-08-22).

Reported by Benno Schulenberg <bensberg@telfort.nl> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-08/msg00202.html>.

* lib/verify.h (assume): Use '_Bool' or 'bool' as type of the temporary
variable.

4 years agolibc-config: Improve comments.
Bruno Haible [Sun, 23 Aug 2020 13:45:48 +0000 (15:45 +0200)]
libc-config: Improve comments.

* lib/cdefs.h (__warndecl, __warnattr, __errordecl): Explain why we
cannot use clang's __diagnose_if__ here.

4 years agoverify: Do use __builtin_assume on clang.
Bruno Haible [Sat, 22 Aug 2020 22:52:39 +0000 (00:52 +0200)]
verify: Do use __builtin_assume on clang.

* lib/verify.h (assume): Use clang’s __builtin_assume, with a temporary
variable in a statement expression.

4 years agosig2str: Add more signals.
Bruno Haible [Sat, 22 Aug 2020 22:50:41 +0000 (00:50 +0200)]
sig2str: Add more signals.

* lib/sig2str.c (numname_table): Add SIGCPUFAIL, SIGTHR, SIGBREAK.

4 years agodoc: Update for OpenBSD 6.0, 6.7.
Bruno Haible [Sat, 22 Aug 2020 22:44:24 +0000 (00:44 +0200)]
doc: Update for OpenBSD 6.0, 6.7.

* doc/*/*.texi: Update.
* m4/printf.m4: Update comments and cross-compilation guesses.
* m4/ceill.m4: Update comments.
* m4/getcwd-abort-bug.m4: Likewise.
* m4/ilogb.m4: Likewise.
* m4/ilogbf.m4: Likewise.
* m4/langinfo_h.m4: Likewise.
* m4/modf.m4: Likewise.
* m4/modff.m4: Likewise.

4 years agodoc: Mention sig2str module.
Bruno Haible [Sat, 22 Aug 2020 15:52:06 +0000 (17:52 +0200)]
doc: Mention sig2str module.

* doc/glibc-functions/sigabbrev_np.texi: Mention the sig2str module.

4 years agosigdescr_np: Add tests.
Bruno Haible [Sat, 22 Aug 2020 00:23:49 +0000 (02:23 +0200)]
sigdescr_np: Add tests.

* tests/test-sigdescr_np.c: New file.
* modules/sigdescr_np-tests: New file.

4 years agosigdescr_np: New module.
Bruno Haible [Sat, 22 Aug 2020 00:22:05 +0000 (02:22 +0200)]
sigdescr_np: New module.

* lib/string.in.h (sigdescr_np): New declaration.
* lib/sigdescr_np.c: New file.
* m4/sigdescr_np.m4: New file.
* m4/string_h.m4 (gl_HEADER_STRING_H_BODY): Test whether sigdescr_np is
declared.
(gl_HEADER_STRING_H_DEFAULTS): Initialize GNULIB_SIGDESCR_NP,
HAVE_SIGDESCR_NP.
* modules/string (Makefile.am): Substitute GNULIB_SIGDESCR_NP,
HAVE_SIGDESCR_NP.
* modules/sigdescr_np: New file.
* tests/test-string-c++.cc: Verify the signature of sigdescr_np.
* doc/glibc-functions/sigdescr_np.texi: Mention the new module.

4 years agosigabbrev_np: Add tests.
Bruno Haible [Thu, 20 Aug 2020 22:55:43 +0000 (00:55 +0200)]
sigabbrev_np: Add tests.

* tests/test-sigabbrev_np.c: New file.
* modules/sigabbrev_np-tests: New file.

4 years agosigabbrev_np: New module.
Bruno Haible [Thu, 20 Aug 2020 22:54:18 +0000 (00:54 +0200)]
sigabbrev_np: New module.

* lib/string.in.h (sigabbrev_np): New declaration.
* lib/sigabbrev_np.c: New file.
* m4/sigabbrev_np.m4: New file.
* m4/string_h.m4 (gl_HEADER_STRING_H_BODY): Test whether sigabbrev_np is
declared.
(gl_HEADER_STRING_H_DEFAULTS): Initialize GNULIB_SIGABBREV_NP,
HAVE_SIGABBREV_NP.
* modules/string (Makefile.am): Substitute GNULIB_SIGABBREV_NP,
HAVE_SIGABBREV_NP.
* modules/sigabbrev_np: New file.
* tests/test-string-c++.cc: Verify the signature of sigabbrev_np.
* doc/glibc-functions/sigabbrev_np.texi: Mention the new module.

4 years agostdalign tests: Skip test with AIX xlclang.
Bruno Haible [Thu, 20 Aug 2020 22:43:57 +0000 (00:43 +0200)]
stdalign tests: Skip test with AIX xlclang.

* tests/test-stdalign.c (main): Skip alignas tests with AIX xlclang.

4 years agostdalign: Fix test failures on 32-bit platforms with clang versions < 8.
Bruno Haible [Thu, 20 Aug 2020 21:52:23 +0000 (23:52 +0200)]
stdalign: Fix test failures on 32-bit platforms with clang versions < 8.

* lib/stdalign.in.h (_Alignof): For clang versions < 8, use the same
workaround as for GCC versions < 4.9.

4 years ago; Update ChangeLog to match recent commits.
Paul Eggert [Thu, 20 Aug 2020 17:44:00 +0000 (10:44 -0700)]
; Update ChangeLog to match recent commits.

4 years agoSync up ProjectQuirks comments and documentation
Siddhesh Poyarekar [Thu, 20 Aug 2020 03:13:47 +0000 (08:43 +0530)]
Sync up ProjectQuirks comments and documentation

Transform the ProjectQuirks comments into a docstring so that it can
be accessed from python as ProjectQuirks.__doc__ and harmonize
descriptions with the documentation.

* build-aux/vcstocl/projectquirks.py (ProjectQuirks):
Transform comments into a docstring.
* doc/vcs-to-changelog.texi: Sync up description with
comments.

4 years agoSplit ProjectQuirks out into its own file
Siddhesh Poyarekar [Thu, 20 Aug 2020 03:13:46 +0000 (08:43 +0530)]
Split ProjectQuirks out into its own file

ProjectQuirks is used by external quirks files and importing it from
vcs-to-changelog.py is broken since it was renamed to use hyphens.  It
is cleaner to put it in its own file anyway.

* build-aux/vcstocl/projectquirks.py: A new file...
* build-aux/vcs-to-changelog.py (ProjectQuirks): ...to which
we move ProjectQuirks and import the file.

4 years agouchar: Fix compilation errors in C++ mode on macOS.
Bruno Haible [Wed, 19 Aug 2020 23:27:02 +0000 (01:27 +0200)]
uchar: Fix compilation errors in C++ mode on macOS.

* m4/uchar.m4 (gl_UCHAR_H): Require gl_ANSI_CXX if present. Include some
system header file before attempting to use 'char16_t' and 'char32_t'.

4 years agoansi-c++-opt: Work around an autoconf macro reordering problem.
Bruno Haible [Wed, 19 Aug 2020 22:42:05 +0000 (00:42 +0200)]
ansi-c++-opt: Work around an autoconf macro reordering problem.

* modules/ansi-c++-opt: Require gl_ANSI_CXX already in the early
section.

4 years agomath C++ tests: Fix compilation error in with GCC 10.
Bruno Haible [Wed, 19 Aug 2020 19:29:08 +0000 (21:29 +0200)]
math C++ tests: Fix compilation error in with GCC 10.

* lib/math.in.h (cbrt, ceil, copysign, exp2, expm1, floor, fma, fmod,
hypot, ilogb, log, log10, log1p, log2, logb, modf, remainder, rint,
round, trunc): Use _GL_CXXALIASWARN1 instead of _GL_CXXALIASWARN.

4 years agouchar: Fix compilation errors in C++ mode on OpenBSD.
Bruno Haible [Wed, 19 Aug 2020 18:40:20 +0000 (20:40 +0200)]
uchar: Fix compilation errors in C++ mode on OpenBSD.

* lib/uchar.in.h (char16_t, char32_t): Don't define in C++ mode if
CXX_HAS_UCHAR_TYPES is 1.
* m4/uchar.m4 (gl_UCHAR_H): Determine whether the C++ compiler
predefines char16_t and char32_t. Substitute CXX_HAS_UCHAR_TYPES.
* modules/uchar (Makefile.am): Substitute CXX_HAS_UCHAR_TYPES.

4 years agoFix compilation errors in C++ mode on OpenBSD.
Bruno Haible [Wed, 19 Aug 2020 08:39:59 +0000 (10:39 +0200)]
Fix compilation errors in C++ mode on OpenBSD.

* lib/math.in.h (isfinite, isinf, isnan, signbit): In C++ mode on
OpenBSD with clang, use the approach without C preprocessor macro.

4 years agouchar C++ tests: Fix side effect on math modules (regr. 2020-08-17).
Bruno Haible [Wed, 19 Aug 2020 01:18:52 +0000 (03:18 +0200)]
uchar C++ tests: Fix side effect on math modules (regr. 2020-08-17).

* modules/uchar-c++-tests (configure.ac): Don't use AC_LANG_PUSH and
AC_LANG_POP.

4 years agoautoupdate
Paul Eggert [Tue, 18 Aug 2020 22:32:14 +0000 (15:32 -0700)]
autoupdate

4 years agoverify: avoid __built_assume on Clang
Paul Eggert [Mon, 17 Aug 2020 21:47:45 +0000 (14:47 -0700)]
verify: avoid __built_assume on Clang

* lib/verify.h (assume): Do not use Clang’s __builtin_assume, as
Clang 9 incorrectly diagnoses arguments as having side effects
even when they do not.  I guess Clang 9 considers any function
call as if it had a side effect here.

4 years agolibc-config: avoid Clang’s __diagnose_if__
Paul Eggert [Mon, 17 Aug 2020 21:45:38 +0000 (14:45 -0700)]
libc-config: avoid Clang’s __diagnose_if__

* lib/cdefs.h (__warndecl, __warnattr, __errordecl):
For now, do not use __diagnose_if__ here, as this fails
on Fedora 31 with Clang 9.0.1, with diagnostic
"/usr/include/bits/stdio2.h:263:9: error: fgets called with bigger
size than length of destination buffer
[-Werror,-Wuser-defined-warnings]".  I guess Clang 9 warns even
for functions that are not called?

4 years agocareadlinkat: speedup for GCC 10 with GCC_LINT
Paul Eggert [Mon, 17 Aug 2020 19:39:48 +0000 (12:39 -0700)]
careadlinkat: speedup for GCC 10 with GCC_LINT

Inspired by a suggestion by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2020-08/msg00155.html
* lib/careadlinkat.c (STACK_BUF_SIZE): New constant.
(readlink_stk): New function, with most of the old careadlinkat
contents and with a new STACK_BUF arg.  Inline it in GCC 10
if GCC_LINT.
(careadlinkat): Use the new function for everything but the
stack buffer.

4 years ago* build-aux/gcc-warning.spec: Update comments.
Paul Eggert [Mon, 17 Aug 2020 19:36:28 +0000 (12:36 -0700)]
* build-aux/gcc-warning.spec: Update comments.

4 years agoAssume autoconf >= 2.64.
Bruno Haible [Mon, 17 Aug 2020 18:06:23 +0000 (20:06 +0200)]
Assume autoconf >= 2.64.

* m4/std-gnu11.m4 (AC_PROG_CC, AC_PROG_CXX): Use _AC_DO_LIMIT always.

4 years agoRevert autoupdate's revert.
Bruno Haible [Mon, 17 Aug 2020 18:10:30 +0000 (20:10 +0200)]
Revert autoupdate's revert.

* config/srclist.txt: Mark regcomp.c as needing sync with glibc.

4 years agoautoupdate
Karl Berry [Mon, 17 Aug 2020 14:34:26 +0000 (07:34 -0700)]
autoupdate

4 years agouchar C++ tests: Fix build error on FreeBSD 12.
Bruno Haible [Mon, 17 Aug 2020 08:39:03 +0000 (10:39 +0200)]
uchar C++ tests: Fix build error on FreeBSD 12.

* modules/uchar-c++-tests (configure.ac): Test whether <cuchar> exists.
(Makefile.am): Don't include test-uchar-c++2.cc in the compilation if
<cuchar> does not exist.

4 years agotime_rz: remove unused functions
Paul Eggert [Sun, 16 Aug 2020 21:11:11 +0000 (14:11 -0700)]
time_rz: remove unused functions

* lib/time_rz.c (isdst_differ, equal_tm): Remove; no longer used.

4 years agotime_rz: fix issues with mktime_z failures
Paul Eggert [Sun, 16 Aug 2020 18:54:44 +0000 (11:54 -0700)]
time_rz: fix issues with mktime_z failures

* lib/time_rz.c (mktime_z): Do not update *TM if revert_tz fails.
Use a cheaper tm_yday test for failed mktime.

4 years agointprops test: Strengthen on clang.
Bruno Haible [Sun, 16 Aug 2020 17:14:43 +0000 (19:14 +0200)]
intprops test: Strengthen on clang.

* tests/test-intprops.c (VERIFY): Use verify_stmt.

4 years agonstrftime: Guide inlining also on clang.
Bruno Haible [Sun, 16 Aug 2020 17:13:57 +0000 (19:13 +0200)]
nstrftime: Guide inlining also on clang.

* lib/nstrftime.c (iso_week_days): Inline also on clang.

4 years agointprops: Avoid bogus "warning: division by zero is undefined" on clang.
Bruno Haible [Sun, 16 Aug 2020 17:12:28 +0000 (19:12 +0200)]
intprops: Avoid bogus "warning: division by zero is undefined" on clang.

* lib/intprops.h (_GL__GENERIC_BOGUS): Define to 1 on clang.

4 years agolog2l: Disable MSVC workaround on clang.
Bruno Haible [Sun, 16 Aug 2020 17:10:32 +0000 (19:10 +0200)]
log2l: Disable MSVC workaround on clang.

* lib/log2l.c (log2l): On clang, use the expression 0.0L/0.0L.

4 years agoargp: Emit a warning also with clang.
Bruno Haible [Sun, 16 Aug 2020 17:09:00 +0000 (19:09 +0200)]
argp: Emit a warning also with clang.

* lib/argp-help.c (__argp_short_program_name): Use #warning also on
clang.

4 years agolibc-config: Enable __REDIRECT macro also on clang.
Bruno Haible [Sun, 16 Aug 2020 17:06:58 +0000 (19:06 +0200)]
libc-config: Enable __REDIRECT macro also on clang.

* lib/cdefs.h (__REDIRECT, __REDIRECT_NTH, __REDIRECT_NTHNL, __ASMNAME,
__ASMNAME2): Define on clang like on GCC.

4 years agoregex: Use initializer shorthand syntax also with clang.
Bruno Haible [Sun, 16 Aug 2020 17:03:49 +0000 (19:03 +0200)]
regex: Use initializer shorthand syntax also with clang.

* lib/regcomp.c (utf8_sb_map): Use the initializer shorthand syntax also
with clang.

4 years agoregex: Use space optimization also with clang.
Bruno Haible [Sun, 16 Aug 2020 17:01:01 +0000 (19:01 +0200)]
regex: Use space optimization also with clang.

* lib/regex_internal.h (re_token_t): Use a single byte for the type also
with clang.

4 years agoUse _Static_assert and static_assert primitives when present on clang.
Bruno Haible [Sun, 16 Aug 2020 16:59:14 +0000 (18:59 +0200)]
Use _Static_assert and static_assert primitives when present on clang.

* lib/cdefs.h (_Static_assert): Don't define as a macro on clang.
* lib/verify.h (_GL_HAVE__STATIC_ASSERT, _GL_HAVE__STATIC_ASSERT1,
_GL_HAVE_STATIC_ASSERT1): Define as appropriate on clang.

4 years agoUse 'throw ()' for optimization in C++ mode also on clang.
Bruno Haible [Sun, 16 Aug 2020 16:57:22 +0000 (18:57 +0200)]
Use 'throw ()' for optimization in C++ mode also on clang.

* lib/cdefs.h (__THROW): Define to 'throw ()' also on clang.
* lib/getopt-cdefs.in.h (__THROW): Likewise.
* lib/md5.h (__THROW): Likewise.

4 years agoabsolute-header: Add support for clang.
Bruno Haible [Sun, 16 Aug 2020 16:54:44 +0000 (18:54 +0200)]
absolute-header: Add support for clang.

* modules/absolute-header (Makefile.am): Include '__clang__' in the
HAVE_INCLUDE_NEXT expression.

4 years agoFix "warning: implicitly declaring library function 'strcasecmp'".
Bruno Haible [Sun, 16 Aug 2020 16:51:09 +0000 (18:51 +0200)]
Fix "warning: implicitly declaring library function 'strcasecmp'".

* lib/argp-help.c: Include <strings.h>.

4 years agostdio: Don't break attribute 'scanf' on clang.
Bruno Haible [Sun, 16 Aug 2020 16:47:47 +0000 (18:47 +0200)]
stdio: Don't break attribute 'scanf' on clang.

* lib/stdio.in.h (scanf): Treat clang like GCC.

4 years agoUse __restrict also on clang.
Bruno Haible [Sun, 16 Aug 2020 16:44:53 +0000 (18:44 +0200)]
Use __restrict also on clang.

* lib/argp.h (__restrict): Don't define as a macro on clang >= 3.
* lib/glob.in.h (_Restrict_): Use __restrict on clang >= 3.
* lib/unitypes.in.h (_UC_RESTRICT): Likewise.

4 years agopthread-spin: Use GCC built-ins also on clang.
Bruno Haible [Sun, 16 Aug 2020 16:42:02 +0000 (18:42 +0200)]
pthread-spin: Use GCC built-ins also on clang.

* lib/pthread-spin.c (pthread_spin_init, pthread_spin_lock,
pthread_spin_trylock, pthread_spin_unlock): Use the newer GCC built-ins
also on clang.

4 years agoasyncsafe-spin tests: Update.
Bruno Haible [Sun, 16 Aug 2020 16:41:57 +0000 (18:41 +0200)]
asyncsafe-spin tests: Update.

* tests/test-asyncsafe-spin2.c: Update to match the change in
lib/asyncsafe-spin.c from 2020-08-11.

4 years agosetenv: Use tree code also with clang.
Bruno Haible [Sun, 16 Aug 2020 16:39:33 +0000 (18:39 +0200)]
setenv: Use tree code also with clang.

* lib/setenv.c (USE_TSEARCH): Treat clang like GCC.

4 years agomath: Optimize signbit also on clang.
Bruno Haible [Sun, 16 Aug 2020 16:39:29 +0000 (18:39 +0200)]
math: Optimize signbit also on clang.

* lib/math.in.h (gl_signbitf, gl_signbitd, gl_signbitl): Optimize also
on clang.

4 years agoavltreehash-list, rbtreehash-list: Optimize also on clang.
Bruno Haible [Sun, 16 Aug 2020 16:36:57 +0000 (18:36 +0200)]
avltreehash-list, rbtreehash-list: Optimize also on clang.

* lib/gl_anytreehash_list1.h (add_nodes_to_buckets): Use
__builtin_expect also on clang.

4 years agoFix "warning: 'WSASocketA' is deprecated: Use WSASocketW() instead".
Bruno Haible [Sun, 16 Aug 2020 11:00:59 +0000 (13:00 +0200)]
Fix "warning: 'WSASocketA' is deprecated: Use WSASocketW() instead".

* lib/socket.c: Use WSASocketW, not WSASocketA.

4 years agoFix "warning: format specifies type 'unsigned long'".
Bruno Haible [Sun, 16 Aug 2020 11:00:57 +0000 (13:00 +0200)]
Fix "warning: format specifies type 'unsigned long'".

* tests/test-nonblocking-writer.h (main_writer_loop): Cast dbgfprintf
argument to match the format directive.

4 years agoFix "warning: no case matching constant switch condition '0'".
Bruno Haible [Sun, 16 Aug 2020 11:00:54 +0000 (13:00 +0200)]
Fix "warning: no case matching constant switch condition '0'".

* tests/test-fcntl.c (check_flags): Add a 'default' case.

4 years agoFix "warning: integer overflow in expression".
Bruno Haible [Sun, 16 Aug 2020 11:00:51 +0000 (13:00 +0200)]
Fix "warning: integer overflow in expression".

* tests/test-strtol.c (main): Use an 'unsigned long' expression to
remove a 'long' overflow.

4 years agoFix "warning: "getpagesize" redefined".
Bruno Haible [Sun, 16 Aug 2020 11:00:48 +0000 (13:00 +0200)]
Fix "warning: "getpagesize" redefined".

* tests/test-getcwd.c (getpagesize): Don't redefine if defined as a
macro.

4 years agoFix "warning: implicitly declaring library function 'strncasecmp'".
Bruno Haible [Sun, 16 Aug 2020 11:00:46 +0000 (13:00 +0200)]
Fix "warning: implicitly declaring library function 'strncasecmp'".

* lib/strptime.c: Include <strings.h>.

4 years agoFix "warning: 'snprintf' macro redefined".
Bruno Haible [Sun, 16 Aug 2020 11:00:43 +0000 (13:00 +0200)]
Fix "warning: 'snprintf' macro redefined".

* lib/strerror_r.c (snprintf): Undefine before redefining.

4 years agoFix "warning: address of array 'locale' will always evaluate to 'true'".
Bruno Haible [Sun, 16 Aug 2020 11:00:40 +0000 (13:00 +0200)]
Fix "warning: address of array 'locale' will always evaluate to 'true'".

* lib/nl_langinfo.c (ctype_codeset): Remove redundant NULL test.

4 years agoFix "warning: '__stat64' macro redefined".
Bruno Haible [Sun, 16 Aug 2020 11:00:38 +0000 (13:00 +0200)]
Fix "warning: '__stat64' macro redefined".

* lib/glob.c (__stat64): Undefine also on MSVC/clang.

4 years agoFix "warning: 'format' attribute argument not supported: rpl_printf".
Bruno Haible [Sun, 16 Aug 2020 11:00:35 +0000 (13:00 +0200)]
Fix "warning: 'format' attribute argument not supported: rpl_printf".

* lib/stdio.in.h (printf): Treat clang like GCC.

4 years agoFix "warning: attribute declaration must precede definition" with clang.
Bruno Haible [Sun, 16 Aug 2020 11:00:17 +0000 (13:00 +0200)]
Fix "warning: attribute declaration must precede definition" with clang.

* lib/math.in.h (acosl, asinl, atanl, ceill, cosl, expl, fabsf, fabsl,
floorl, fmodl, frexpf, frexpl, hypotf, hypotl, ldexpf, ldexpl, logl,
log10l, modfl, sinl, sqrtl, tanl): Disable _GL_CXXALIASWARN invocation
on non-glibc systems.
* lib/netdb.in.h (gai_strerror): Likewise.
* lib/stdio.in.h (snprintf, vfscanf, vscanf, vsnprintf): Likewise.
* lib/sys_stat.in.h (fstat): Likewise.
* lib/utime.in.h (utime): Likewise.

4 years agoFix undesired warnings.
Bruno Haible [Sun, 16 Aug 2020 11:00:05 +0000 (13:00 +0200)]
Fix undesired warnings.

* lib/sys_select.in.h: Disable all _GL_WARN_ON_USE invocations with
clang.

4 years agoC++ tests: Fix link errors on MSVC (regression from 2020-05-31).
Bruno Haible [Sun, 16 Aug 2020 10:53:57 +0000 (12:53 +0200)]
C++ tests: Fix link errors on MSVC (regression from 2020-05-31).

* modules/stdio-c++-tests (Makefile.am): Link test-stdio-c++ with
$(LIB_GETRANDOM), needed for the rpl_tmpfile symbol.
* modules/stdlib-c++-tests (Makefile.am): Link test-stdlib-c++ with
$(LIB_GETRANDOM), needed for the mkdtemp and mkstemp symbols.

4 years agoDon't use Autoconf quadrigraphs.
Bruno Haible [Sun, 16 Aug 2020 10:47:55 +0000 (12:47 +0200)]
Don't use Autoconf quadrigraphs.

* m4/alloca.m4 (_AC_LIBOBJ_ALLOCA): Use '#' instead of the corresponding
Autoconf quadrigraph.
* m4/free.m4 (gl_FUNC_FREE): Likewise.
* m4/getloadavg.m4 (gl_PREREQ_GETLOADAVG): Likewise.
* m4/largefile.m4 (_AC_SYS_LARGEFILE_TEST_INCLUDES,
_AC_SYS_LARGEFILE_MACRO_VALUE): Likewise.
* m4/longlong.m4 (AC_TYPE_LONG_LONG_INT): Likewise.
* m4/math_h.m4 (gl_MATH_H): Likewise.
* m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Likewise.

4 years agoFix quoting of AC_LANG_PROGRAM arguments.
Bruno Haible [Sun, 16 Aug 2020 10:28:42 +0000 (12:28 +0200)]
Fix quoting of AC_LANG_PROGRAM arguments.

* m4/fdopendir.m4 (gl_FUNC_FDOPENDIR): Quote the AC_LANG_PROGRAM
arguments through [[...]].
* m4/fpending.m4 (gl_FUNC_FPENDING): Likewise.
* m4/fpurge.m4 (gl_FUNC_FPURGE): Likewise.
* m4/fseeko.m4 (gl_FUNC_FSEEKO): Likewise.
* m4/ld-output-def.m4 (gl_LD_OUTPUT_DEF): Likewise.
* m4/ld-version-script.m4 (gl_LD_VERSION_SCRIPT): Likewise.
* m4/linkat.m4 (gl_FUNC_LINKAT): Likewise.
* m4/mountlist.m4 (gl_MOUNTLIST): Likewise.
* m4/sys_ioctl_h.m4 (gl_SYS_IOCTL_H): Likewise.
* m4/ungetc.m4 (gl_FUNC_UNGETC_WORKS): Likewise.
* m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Likewise.
* m4/warnings.m4 (gl_COMPILER_OPTION_IF): Likewise.
* m4/wcstok.m4 (gl_FUNC_WCSTOK): Likewise.
* m4/wctype_h.m4 (gl_WCTYPE_H): Likewise.

4 years agoAssume autoconf >= 2.64.
Bruno Haible [Sun, 16 Aug 2020 10:12:32 +0000 (12:12 +0200)]
Assume autoconf >= 2.64.

* gnulib-tool (DEFAULT_AUTOCONF_MINVERSION): Set to 2.64.
* DEPENDENCIES: Require Autoconf 2.64 or newer.
* NEWS: Mention the changed requirement.
* m4/00gnulib.m4 (_m4_divert_diversion, AC_DEFUN_ONCE): Remove macros.
* m4/gnulib-common.m4 (AS_VAR_IF, AS_VAR_COPY): Remove macros.
* m4/absolute-header.m4 (gl_ABSOLUTE_HEADER): Quote pushdef'ed
variables.
* m4/include_next.m4 (gl_NEXT_HEADERS_INTERNAL): Likewise.
* m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Likewise.
* m4/warnings.m4 (gl_COMPILER_OPTION_IF): Likewise.
(gl_UNKNOWN_WARNINGS_ARE_ERRORS(C), gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++),
gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)): Define through AC_DEFUN.
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C), gl_MANYWARN_ALL_GCC(C++)):
Likewise.
* m4/iconv.m4 (AM_ICONV): Define through AC_DEFUN_ONCE directly.
* m4/libunistring.m4 (gl_LIBUNISTRING): Likewise.
* m4/configmake.m4: Update comment.