]>
Savannah Git Hosting - gnulib.git/log
Bruno Haible [Sun, 22 Aug 2021 21:54:40 +0000 (23:54 +0200)]
Make generated .in.h files as standalone as possible.
Reported by Jan Engelhardt <jengelh@inai.de>.
* lib/stdlib.in.h (_GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEALLOC_FREE,
_GL_ATTRIBUTE_MALLOC): Add fallback definitions.
* lib/dirent.in.h (_GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC): Add
fallback definitions.
* lib/stdio.in.h (_GL_ATTRIBUTE_DEALLOC): Add fallback definition.
* lib/math.in.h (_GL_ATTRIBUTE_CONST): Add fallback definition.
* lib/pthread.in.h (_GL_ATTRIBUTE_PURE): Add fallback definition.
* lib/threads.in.h (_GL_ATTRIBUTE_PURE): Likewise.
* lib/uchar.in.h (_GL_ATTRIBUTE_PURE): Likewise.
* lib/string.in.h (_GL_ATTRIBUTE_PURE): Move definition, for consistency
with the other *.in.h files.
* lib/se-context.in.h (_GL_ATTRIBUTE_MAYBE_UNUSED): Add fallback
definition.
* lib/se-label.in.h (_GL_ATTRIBUTE_MAYBE_UNUSED): Likewise.
* lib/se-selinux.in.h (_GL_ATTRIBUTE_MAYBE_UNUSED): Likewise.
* lib/textstyle.in.h: Use _GL_ATTRIBUTE_MAYBE_UNUSED instead of
_GL_UNUSED.
(_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, _GL_ATTRIBUTE_MAYBE_UNUSED): Add
fallback definitions.
Bruno Haible [Sun, 22 Aug 2021 21:40:41 +0000 (23:40 +0200)]
gnulib-common.m4: Clarify logic behind _GL_UNUSED_LABEL.
Reported by Paul Eggert.
* m4/gnulib-common.m4 (gl_COMMON_BODY): Add comment and write the
condition in a way that is close to the comment.
Paul Eggert [Sun, 22 Aug 2021 20:39:24 +0000 (13:39 -0700)]
c-stack: depend on inttypes, mempcpy
* modules/c-stack (Depends-on): Add inttypes, mempcpy.
mempcpy problem reported by Evan Miller in:
https://debbugs.gnu.org/50098#31
Bruno Haible [Sun, 22 Aug 2021 20:26:05 +0000 (22:26 +0200)]
mountlist: Use recommended syntax for _GL_UNUSED_LABEL.
* lib/mountlist.c (read_file_system_list): Add semicolon after
_GL_UNUSED_LABEL.
Bruno Haible [Sun, 22 Aug 2021 20:11:50 +0000 (22:11 +0200)]
gnulib-common.m4: Make _GL_UNUSED_LABEL effective for clang.
* m4/gnulib-common.m4 (gl_COMMON_BODY): Make _GL_UNUSED_LABEL use
_GL_ATTRIBUTE_UNUSED also for clang.
Bruno Haible [Sun, 22 Aug 2021 20:09:15 +0000 (22:09 +0200)]
Oops, remove unintended file additions.
Bruno Haible [Sun, 22 Aug 2021 20:04:34 +0000 (22:04 +0200)]
gnulib-common.m4: Use C2x [[maybe_unused]] when possible.
* m4/gnulib-common.m4 (gl_COMMON_BODY): Define _GL_UNUSED as an alias of
_GL_ATTRIBUTE_MAYBE_UNUSED, not of _GL_ATTRIBUTE_UNUSED.
* lib/binary-io.h (__gl_setmode): Put _GL_UNUSED before, not after, the
declaration.
* lib/c-stack.c (null_action, segv_handler, overflow_handler,
c_stack_action): Likewise.
* lib/chown.c (chown): Likewise.
* lib/clean-temp-simple.c (cleanup_action): Likewise.
* lib/fts.c (dirent_inode_sort_may_be_useful, leaf_optimization,
fts_set): Likewise.
* lib/getgroups.c (getgroups): Likewise.
* lib/getopt.c (_getopt_initialize): Likewise.
* lib/getugroups.c (getugroups): Likewise.
* lib/localename.c (gl_locale_name_thread_unsafe, gl_locale_name_thread,
gl_locale_name_posix, gl_locale_name_environ): Likewise.
* lib/mkdir.c (rpl_mkdir): Likewise.
* lib/mkfifo.c (mkfifo): Likewise.
* lib/mkfifoat.c (mkfifoat): Likewise.
* lib/mknod.c (mknod): Likewise.
* lib/mknodat.c (mknodat): Likewise.
* lib/mountlist.c (me_remote): Likewise.
* lib/openpty.c (openpty): Likewise.
* lib/parse-datetime.y (yyerror): Likewise.
* lib/passfd.c (sendfd, recvfd): Likewise.
* lib/pthread-cond.c (pthread_condattr_destroy, pthread_cond_init,
pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
pthread_cond_broadcast, pthread_cond_destroy): Likewise.
* lib/pthread-mutex.c (pthread_mutexattr_destroy, pthread_mutex_init,
pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_timedlock,
pthread_mutex_unlock, pthread_mutex_destroy): Likewise.
* lib/pthread-rwlock.c (pthread_rwlockattr_destroy, pthread_rwlock_init,
pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock): Likewise.
* lib/pthread-spin.c (pthread_spin_init, pthread_spin_lock,
pthread_spin_trylock, pthread_spin_unlock, pthread_spin_destroy):
Likewise.
* lib/pthread-thread.c (pthread_attr_destroy): Likewise.
* lib/readlink.c (readlink): Likewise.
* lib/rename.c (rpl_rename): Likewise.
* lib/set-permissions.c (set_permissions): Likewise.
* lib/sockets.c (gl_sockets_startup): Likewise.
* lib/stat-time.h (get_stat_birthtime_ns, get_stat_birthtime,
stat_time_normalize): Likewise.
* lib/strptime.c (__strptime_internal): Likewise.
* lib/strtod.c (LDEXP): Likewise.
* lib/symlink.c (symlink): Likewise.
* lib/symlinkat.c (symlinkat): Likewise.
* lib/tempname.c (try_dir, try_nocreate): Likewise.
* lib/textstyle.in.h (styled_ostream_begin_use_class,
styled_ostream_end_use_class, styled_ostream_get_hyperlink_ref,
styled_ostream_get_hyperlink_id, styled_ostream_set_hyperlink,
styled_ostream_flush_to_current_style, fd_ostream_create,
term_ostream_get_color, term_ostream_set_color,
term_ostream_get_bgcolor, term_ostream_set_bgcolor,
term_ostream_get_weight, term_ostream_set_weight,
term_ostream_get_posture, term_ostream_set_posture,
term_ostream_get_underline, term_ostream_set_underline,
term_ostream_get_hyperlink_ref, term_ostream_get_hyperlink_id,
term_ostream_set_hyperlink, term_ostream_create,
term_styled_ostream_create, html_styled_ostream_create,
handle_color_option, handle_style_option, style_file_prepare,
styled_ostream_create, libtextstyle_set_failure_exit_code): Likewise.
* lib/unicodeio.c (exit_failure_callback, fallback_failure_callback):
Likewise.
* lib/wait-process.c (cleanup_slaves_action): Likewise.
* tests/signature.h (SIGNATURE_CHECK2): Likewise.
* tests/test-areadlink.c (do_areadlink): Likewise.
* tests/test-areadlinkat.c (do_areadlinkat): Likewise.
* tests/test-ceilf-ieee.c (main): Likewise.
* tests/test-ceilf1.c (main): Likewise.
* tests/test-dirent.c (dir): Likewise.
* tests/test-fchownat.c (main): Likewise.
* tests/test-fdopendir.c (main): Likewise.
* tests/test-filenamecat.c (main): Likewise.
* tests/test-floor1.c (main): Likewise.
* tests/test-floorf-ieee.c (main): Likewise.
* tests/test-floorf1.c (main): Likewise.
* tests/test-fseeko.c (main): Likewise.
* tests/test-fstatat.c (main): Likewise.
* tests/test-ftello.c (main): Likewise.
* tests/test-getdomainname.c (main): Likewise.
* tests/test-getgroups.c (main): Likewise.
* tests/test-gethostname.c (main): Likewise.
* tests/test-math-c++.cc (OVERLOADED_CHECK): Likewise.
* tests/test-mkdirat.c (main): Likewise.
* tests/test-openat.c (main): Likewise.
* tests/test-parse-datetime.c (main): Likewise.
* tests/test-quotearg-simple.c (main): Likewise.
* tests/test-quotearg.c (main): Likewise.
* tests/test-sethostname2.c (main): Likewise.
* tests/test-unlinkat.c (main): Likewise.
* tests/test-version-etc.c (main): Likewise.
* tests/test-xalloc-die.c (main): Likewise.
* tests/test-xfprintf-posix.c (main): Likewise.
* tests/test-xprintf-posix.c (main): Likewise.
* tests/test-xvasprintf.c (main): Likewise.
Bruno Haible [Sun, 22 Aug 2021 19:58:31 +0000 (21:58 +0200)]
gnulib-common.m4: Document the gnulib-internal _GL_ATTRIBUTE_* macros.
* m4/gnulib-common.m4 (gl_COMMON_BODY): Add comments to the
_GL_ATTRIBUTE_* macros, based on lib/attribute.h.
Bernhard Voelker [Sun, 22 Aug 2021 14:06:47 +0000 (16:06 +0200)]
doc: fix order of stdlib functions
* doc/gnulib.texi (node Glibc stdlib.h): Move mrand48_r after mkstemps.
Reported by Benno Schulenberg.
Bruno Haible [Sat, 21 Aug 2021 23:25:59 +0000 (01:25 +0200)]
c-stack: Test for libsigsegv once, not twice.
* m4/sigsegv.m4: New file, based on modules/sigsegv.
* modules/sigsegv (Files): Add it.
(configure.ac): Require gl_SIGSEGV. Test gl_sigsegv_uses_libsigsegv
instead of with_libsigsegv and gl_cv_lib_sigsegv.
* m4/c-stack.m4 (gl_C_STACK): Likewise.
Bruno Haible [Sat, 21 Aug 2021 22:32:40 +0000 (00:32 +0200)]
rawmemchr: Fix use in relocatable-prog-wrapper (regression 2021-08-20).
* lib/rawmemchr.c: Restore test of HAVE_RAWMEMCHR.
* modules/relocatable-prog-wrapper (Depends-on): Add stdalign.
Karl Berry [Sat, 21 Aug 2021 15:27:26 +0000 (08:27 -0700)]
autoupdate
Paul Eggert [Sat, 21 Aug 2021 02:25:06 +0000 (19:25 -0700)]
rawmemchr: modernize and simplify
* lib/rawmemchr.c (HAVE_RAWMEMCHR): Assume it’s not defined;
otherwise this file would not be compiled. Include limits.h,
stdalign.h, stdint.h, verify.h.
(rawmemchr): Prefer uintptr_t to unsigned long and to size_t when
it’s the better type. Verify that longword lacks padding. Use
alignof rather than sizeof when checking alignment. Simplify by
assuming C99 decl-after-statement, and by using multiplication
rather than repeated shifting and OR (modern compilers can
optimize the multiplication if needed). Avoid unnecessary casts.
Don’t assume CHAR_WIDTH is 8. Convert back and forth between void *
to suppress bogus GCC warnings about alignment. Omit a
duplicate assignment to char_ptr.
* modules/rawmemchr (Depends-on): Add stdalign, stdint, verify.
Karl Berry [Wed, 18 Aug 2021 14:01:44 +0000 (07:01 -0700)]
autoupdate
Paul Eggert [Tue, 17 Aug 2021 19:06:42 +0000 (12:06 -0700)]
c-stack: fix libsigsegv dependency
Problem reported for GNU grep by Evan Miller (Bug#50098).
* m4/c-stack.m4 (gl_C_STACK): Call gl_LIBSIGSEGV before
testing gl_cv_lib_sigsegv.
Bruno Haible [Sat, 14 Aug 2021 20:07:33 +0000 (22:07 +0200)]
doc: Update for glibc 2.34.
* doc/posix-functions/timespec_getres.texi: New file.
* doc/glibc-functions/_Fork.texi: New file.
* doc/glibc-functions/closefrom.texi: New file.
* doc/glibc-functions/dn_comp.texi: New file.
* doc/glibc-functions/dn_skipname.texi: New file.
* doc/glibc-functions/execveat.texi: New file.
* doc/glibc-functions/posix_spawn_file_actions_addclosefrom_np.texi: New
file.
* doc/glibc-functions/res_dnok.texi: New file.
* doc/glibc-functions/res_hnok.texi: New file.
* doc/glibc-functions/res_mailok.texi: New file.
* doc/glibc-functions/res_nmkquery.texi: New file.
* doc/glibc-functions/res_nquery.texi: New file.
* doc/glibc-functions/res_nquerydomain.texi: New file.
* doc/glibc-functions/res_nsearch.texi: New file.
* doc/glibc-functions/res_nsend.texi: New file.
* doc/glibc-functions/res_ownok.texi: New file.
* doc/glibc-functions/res_send.texi: New file.
* doc/gnulib.texi: Include them.
* doc/glibc-functions/inet_neta.texi: Remove file.
* doc/glibc-functions/malloc_get_state.texi: Remove file.
* doc/glibc-functions/malloc_set_state.texi: Remove file.
* doc/glibc-functions/pthread_mutex_consistent_np.texi: Remove file.
* doc/glibc-functions/pthread_mutexattr_getrobust_np.texi: Remove file.
* doc/glibc-functions/pthread_mutexattr_setrobust_np.texi: Remove file.
* doc/glibc-functions/pthread_yield.texi: Remove file.
* doc/gnulib.texi: Don't include them.
* doc/glibc-headers/resolv.texi: Update.
* doc/pastposix-functions/h_errno.texi: Likewise.
* doc/posix-functions/*.texi: Likewise.
* doc/glibc-functions/*.texi: Likewise.
Paul Eggert [Thu, 12 Aug 2021 21:36:34 +0000 (14:36 -0700)]
memrchr-tests: port to GCC 12
* tests/test-memrchr.c: Bug#101494 is fixed in GCC 12.
Akim Demaille [Thu, 12 Aug 2021 07:30:41 +0000 (09:30 +0200)]
snippet/_Noreturn: Fix typo
* lib/_Noreturn.h: Fix spelling of 4.
Paul Eggert [Wed, 11 Aug 2021 20:00:57 +0000 (13:00 -0700)]
dynarray: merge from glibc
This also helps document glibc’s direction in using GCC’s
memory-allocation checking.
* lib/cdefs.h: Omit comments that glibc rejected.
(__returns_nonnull, __attr_access_none, __attr_dealloc)
(__attr_dealloc_free): New macros.
* lib/libc-config.h: Undef the new macros that are defined
unconditionally.
* lib/malloc/dynarray_at_failure.c [_LIBC]: Do not include stdlib.h.
(__libc_dynarray_at_failure) [_LIBC]: Call __libc_fatal,
fixing a bad merge previously.
Bruno Haible [Sun, 8 Aug 2021 20:11:03 +0000 (22:11 +0200)]
canonicalize-lgpl: Fix conflict with z/OS <sys/stat.h>.
Reported by Mike Fulton <mikefultonpersonal@gmail.com> in
<https://lists.gnu.org/archive/html/m4-discuss/2021-08/msg00000.html>
via Eric Blake.
* lib/canonicalize-lgpl.c (__stat): Remove macro.
(file_accessible): Use 'stat' instead.
Bruno Haible [Sun, 8 Aug 2021 19:56:42 +0000 (21:56 +0200)]
ptsname_r: Drop sync with glibc.
* lib/ptsname_r.c: Drop _LIBC code.
(__set_errno, __isatty, __stat, __ttyname_r, __ptsname_r): Remove
macros.
(ptsname_r): Rename local variable 'save_errno'.
Bruno Haible [Sun, 8 Aug 2021 19:42:26 +0000 (21:42 +0200)]
config: Update after glibc changed.
* config/srclist.txt: Remove two files that glibc dropped on 2013-12-17.
Bruno Haible [Sun, 8 Aug 2021 17:11:31 +0000 (19:11 +0200)]
relocatable-lib-lgpl: Fix a memory leak related to a Windows DLL.
Reported by Jonathan Boeing <jonathan@claws-mail.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-08/msg00048.html>.
* lib/relocatable.c (DllMain): Avoid memory leak in a special case
of repeated attach/detach.
Bruno Haible [Sun, 8 Aug 2021 16:54:06 +0000 (18:54 +0200)]
fopen: Fix link error on native Windows.
* modules/fopen (Depends-on): Add close.
Bruno Haible [Sun, 8 Aug 2021 16:38:45 +0000 (18:38 +0200)]
fopen: Fix compilation error on AIX (regression from 2020-05-28).
* modules/fopen (Depends-on): Add fcntl-h.
Bruno Haible [Sun, 8 Aug 2021 16:27:56 +0000 (18:27 +0200)]
stdio: Improve GCC 11 allocation-deallocation checking.
* lib/stdio.in.h (fdopen, fopen, tmpfile): For GCC >= 11: Declare nearly
always.
(popen): For GCC >= 11: Declare also when the platform already declares
the function or when the module 'popen' is not in use.
Bruno Haible [Sun, 8 Aug 2021 16:23:46 +0000 (18:23 +0200)]
dirent: Improve GCC 11 allocation-deallocation checking.
* lib/dirent.in.h (opendir): For GCC >= 11: Declare also when the
platform already declares the function or when the module 'opendir' is
not in use.
(fdopendir): For GCC >= 11: Declare also when the platform already
declares the function or when the module 'fdopendir' is not in use.
Bruno Haible [Sun, 8 Aug 2021 16:18:25 +0000 (18:18 +0200)]
stdlib, string, wchar: Improve GCC 11 allocation-deallocation checking.
* lib/stdlib.in.h (aligned_alloc): For GCC >= 11: Declare also when the
platform already declares the function or when the module
'aligned_alloc' is not in use.
(calloc): For GCC >= 11: Declare nearly always.
(canonicalize_file_name): For GCC >= 11: Declare also when the platform
already declares the function or when the module 'canonicalize-lgpl' is
not in use.
(malloc, realloc): For GCC >= 11: Declare nearly always.
* lib/malloc.in.h: Remove redundant include.
(memalign): For GCC >= 11: Declare also when the platform already
declares the function or when the module 'memalign' is not in use.
* lib/string.in.h: Include <stdlib.h> always.
(strdup): For GCC >= 11: Declare also when the platform already declares
the function or when the module 'strdup' or 'strdup-posix' is not in
use.
* lib/wchar.in.h: Include <stdlib.h> always.
(wcsdup): For GCC >= 11: Declare also when the platform already declares
the function or when the module 'wcsdup' is not in use.
* modules/free-posix (Depends-on): Add string, wchar.
Bruno Haible [Sun, 8 Aug 2021 01:52:01 +0000 (03:52 +0200)]
gnulib-tool: Add support for Automake 1.16.4.
Reported by <shoober420@gmail.com> in
<https://lists.gnu.org/archive/html/bug-libunistring/2021-08/msg00000.html>.
* build-aux/test-driver-1.16.3.diff: Renamed from build-aux/test-driver.diff.
* build-aux/test-driver.diff: Update to match Automake 1.16.4.
* gnulib-tool (func_create_testdir, func_create_megatestdir): Try both
.diff files.
Bruno Haible [Sun, 8 Aug 2021 00:51:24 +0000 (02:51 +0200)]
gnulib-common.m4: Minor style fix.
* m4/gnulib-common.m4 (gl_COMMON_BODY): Keep list of attributes sorted
alphabetically.
Bruno Haible [Sun, 8 Aug 2021 00:14:11 +0000 (02:14 +0200)]
uninorm, unistr: Improve GCC 11 allocation-deallocation checking.
* lib/uninorm.in.h (uninorm_filter_free): Move declaration up.
(uninorm_filter_create): Declare that deallocation must happen through
'uninorm_filter_free'.
* lib/unistr.in.h: Include <stdlib.h>.
(u8_strdup, u16_strdup, u32_strdup): Declare that deallocation must
happen through 'free'.
Bruno Haible [Sat, 7 Aug 2021 22:11:49 +0000 (00:11 +0200)]
ialloc: Prepare for allocation-deallocation checking.
* lib/ialloc.h (imalloc, irealloc, icalloc): Add comment that
deallocation must happen through 'free'.
Bruno Haible [Sat, 7 Aug 2021 22:09:10 +0000 (00:09 +0200)]
aligned-malloc: Prepare for allocation-deallocation checking.
* lib/aligned-malloc.h (aligned_free): Move declaration up.
(aligned_malloc): Add comment that deallocation must happen through
'aligned_free'.
Bruno Haible [Sat, 7 Aug 2021 22:00:36 +0000 (00:00 +0200)]
list, set, oset, map, omap: Prepare allocation-deallocation checking.
* lib/gl_list.h (gl_list_create_empty, gl_list_nx_create_empty,
gl_list_create, gl_list_nx_create): Add comment that deallocation must
happen through 'gl_list_free'.
* lib/gl_xlist.h (gl_list_create_empty, gl_list_create): Likewise.
* lib/gl_sublist.h (gl_sublist_create, gl_sublist_nx_create): Likewise.
* lib/gl_xsublist.h (gl_sublist_create): Likewise.
* lib/gl_set.h (gl_set_create_empty, gl_set_nx_create_empty): Add
comment that deallocation must happen through 'gl_set_free'.
* lib/gl_xset.h (gl_set_create_empty): Likewise.
* lib/gl_oset.h (gl_oset_create_empty, gl_oset_nx_create_empty): Add
comment that deallocation must happen through 'gl_oset_free'.
* lib/gl_xoset.h (gl_oset_create_empty): Likewise.
* lib/gl_map.h (gl_map_create_empty, gl_map_nx_create_empty): Add
comment that deallocation must happen through 'gl_map_free'.
* lib/gl_xmap.h (gl_map_create_empty): Likewise.
* lib/gl_omap.h (gl_omap_create_empty, gl_omap_nx_create_empty): Add
comment that deallocation must happen through 'gl_omap_free'.
* lib/gl_xomap.h (gl_omap_create_empty): Likewise.
Bruno Haible [Sat, 7 Aug 2021 21:36:42 +0000 (23:36 +0200)]
xgetdomainname: Improve GCC 11 allocation-deallocation checking.
* lib/xgetdomainname.h: Include <stdlib.h>.
(xgetdomainname): Declare that deallocation must happen through 'free'.
Bruno Haible [Sat, 7 Aug 2021 21:30:53 +0000 (23:30 +0200)]
xgetdomainname: Ensure .c file starts with '#include <config.h>'.
* lib/xgetaname-impl.h: New file, based on lib/xgethostname.c.
* lib/xgethostname.c: Move implementation to lib/xgetaname-impl.h.
* lib/xgetdomainname.c: Include <config.h>. Include xgetaname-impl.h
instead of xgethostname.c.
* modules/xgethostname (Files): Add lib/xgetaname-impl.h.
* modules/xgetdomainname (Files): Likewise.
(Depends-on): Remove xgethostname. Add free-posix, xalloc.
Bruno Haible [Sat, 7 Aug 2021 21:15:21 +0000 (23:15 +0200)]
xstrndup: Improve GCC 11 allocation-deallocation checking.
* lib/xstrndup.h: Include <stdlib.h> instead of <stddef.h>.
(xstrndup): Declare that deallocation must happen through 'free'.
Bruno Haible [Sat, 7 Aug 2021 21:11:48 +0000 (23:11 +0200)]
xstriconveh: Improve GCC 11 allocation-deallocation checking.
* lib/xstriconveh.h: Include <stdlib.h> instead of <stddef.h>.
(xstr_cd_iconveh, xstr_iconveh): Declare that deallocation must happen
through 'free'.
Bruno Haible [Sat, 7 Aug 2021 21:08:45 +0000 (23:08 +0200)]
xmemdup0: Improve GCC 11 allocation-deallocation checking.
* lib/xmemdup0.h: Include <stdlib.h> instead of <stddef.h>.
(xmemdup0): Declare that deallocation must happen through 'free'.
Bruno Haible [Sat, 7 Aug 2021 21:05:51 +0000 (23:05 +0200)]
windows-spawn: Improve GCC 11 allocation-deallocation checking.
* lib/windows-spawn.h: Include <stdlib.h>.
(compose_command, compose_envblock): Declare that deallocation must
happen through 'free'.
Bruno Haible [Sat, 7 Aug 2021 20:16:55 +0000 (22:16 +0200)]
string-buffer: Improve GCC 11 allocation-deallocation checking.
* lib/string-buffer.h: Include <stdlib.h> instead of <stddef.h>.
(sb_dupfree): Declare that deallocation must happen through 'free'.
Bruno Haible [Sat, 7 Aug 2021 20:14:02 +0000 (22:14 +0200)]
striconveha: Improve GCC 11 allocation-deallocation checking.
* lib/striconveha.h: Include <stdlib.h> instead of <stddef.h>.
(str_iconveha): Declare that deallocation must happen through 'free'.
Bruno Haible [Sat, 7 Aug 2021 20:10:29 +0000 (22:10 +0200)]
striconveh: Improve GCC 11 allocation-deallocation checking.
* lib/striconveh.h: Include <stdlib.h> instead of <stddef.h>.
(str_cd_iconveh, str_iconveh): Declare that deallocation must happen
through 'free'.
Bruno Haible [Sat, 7 Aug 2021 20:08:16 +0000 (22:08 +0200)]
striconv: Improve GCC 11 allocation-deallocation checking.
* lib/striconv.h: Include <stdlib.h> instead of <stddef.h>.
(str_cd_iconv, str_iconv): Declare that deallocation must happen through
'free'.
Bruno Haible [Sat, 7 Aug 2021 20:04:55 +0000 (22:04 +0200)]
relocatable-lib-lgpl: Improve GCC 11 allocation-deallocation checking.
* lib/relocatable.h: Include <stdlib.h>.
(compute_curr_prefix): Declare that deallocation must happen through
'free'.
Bruno Haible [Sat, 7 Aug 2021 20:02:37 +0000 (22:02 +0200)]
regex-quote: Improve GCC 11 allocation-deallocation checking.
* lib/regex-quote.h: Include <stdlib.h> instead of <stddef.h>.
(regex_quote): Declare that deallocation must happen through 'free'.
Bruno Haible [Sat, 7 Aug 2021 19:55:00 +0000 (21:55 +0200)]
readline: Improve GCC 11 allocation-deallocation checking.
* lib/readline.h: Include <stdlib.h>.
(readline): Declare that deallocation must happen through 'free'.
Bruno Haible [Sat, 7 Aug 2021 19:52:48 +0000 (21:52 +0200)]
read-file: Improve GCC 11 allocation-deallocation checking.
* lib/read-file.h: Include <stdlib.h> instead of <stddef.h>.
(fread_file, read_file): Declare that deallocation must happen through
'free'.
Bruno Haible [Sat, 7 Aug 2021 19:49:55 +0000 (21:49 +0200)]
pipe-filter-gi: Improve GCC 11 allocation-deallocation checking.
* lib/pipe-filter.h (pipe_filter_gi_close): Move declaration up.
(pipe_filter_gi_create): Declare that deallocation must happen through
'pipe_filter_gi_close'.
Bruno Haible [Sat, 7 Aug 2021 19:46:24 +0000 (21:46 +0200)]
javaversion: Improve GCC 11 allocation-deallocation checking.
* lib/javaversion.h: Include <stdlib.h>.
(javaexec_version): Declare that deallocation must happen through
'free'.
Bruno Haible [Sat, 7 Aug 2021 17:47:47 +0000 (19:47 +0200)]
ino-map: Improve GCC 11 allocation-deallocation checking.
* lib/ino-map.h (ino_map_free): Move declaration up.
(ino_map_alloc): Declare that deallocation must happen through
'ino_map_free'.
Bruno Haible [Sat, 7 Aug 2021 17:45:19 +0000 (19:45 +0200)]
hash: Improve GCC 11 allocation-deallocation checking.
* lib/hash.h (hash_free): Move declaration up.
(hash_initialize, hash_xinitialize): Declare that deallocation must
happen through 'hash_free'.
Bruno Haible [Sat, 7 Aug 2021 17:42:08 +0000 (19:42 +0200)]
hamt: Improve GCC 11 allocation-deallocation checking.
* lib/hamt.h (hamt_free): Move declaration up.
(hamt_create, hamt_copy): Declare that deallocation must happen through
'hamt_free'.
Bruno Haible [Sat, 7 Aug 2021 17:36:50 +0000 (19:36 +0200)]
get_progname_of: Improve GCC 11 allocation-deallocation checking.
* lib/get_progname_of.h: Include <stdlib.h>.
(get_progname_of): Declare that deallocation must happen through 'free'.
Bruno Haible [Sat, 7 Aug 2021 17:34:16 +0000 (19:34 +0200)]
fts: Improve GCC 11 allocation-deallocation checking.
* lib/fts_.h (fts_open): Declare that deallocation must happen through
'fts_close'.
Bruno Haible [Sat, 7 Aug 2021 17:32:01 +0000 (19:32 +0200)]
eealloc: Improve GCC 11 allocation-deallocation checking.
* lib/eealloc.h (eemalloc): Declare that deallocation must happen
through 'free'.
Bruno Haible [Sat, 7 Aug 2021 17:29:57 +0000 (19:29 +0200)]
di-set: Improve GCC 11 allocation-deallocation checking.
* lib/di-set.h (di_set_free): Move declaration up.
(di_set_alloc): Declare that deallocation must happen through
'di_set_free'.
Bruno Haible [Sat, 7 Aug 2021 17:27:05 +0000 (19:27 +0200)]
[x]concat-filename: Improve GCC 11 allocation-deallocation checking.
* lib/concat-filename.h: Include <stdlib.h>.
(concatenated_filename, xconcatenated_filename): Declare that
deallocation must happen through 'free'.
Bruno Haible [Sat, 7 Aug 2021 17:23:57 +0000 (19:23 +0200)]
clean-temp: Improve GCC 11 allocation-deallocation checking.
* lib/clean-temp.h (cleanup_temp_dir): Move declaration up.
(create_temp_dir): Declare that deallocation must happen through
'cleanup_temp_dir'.
Bruno Haible [Sat, 7 Aug 2021 17:21:19 +0000 (19:21 +0200)]
canon-host: Improve GCC 11 allocation-deallocation checking.
* lib/canon-host.h: Include <stdlib.h>.
(canon_host, canon_host_r): Declare that deallocation must happen
through 'free'.
Bruno Haible [Sat, 7 Aug 2021 17:16:48 +0000 (19:16 +0200)]
c-xvasprintf: Improve GCC 11 allocation-deallocation checking.
* lib/c-xvasprintf.h: Include <stdlib.h>.
(c_xasprintf, c_xvasprintf): Declare that deallocation must happen
through 'free'.
Bruno Haible [Sat, 7 Aug 2021 17:13:56 +0000 (19:13 +0200)]
bitsetv: Improve GCC 11 allocation-deallocation checking.
* lib/bitsetv.h (bitsetv_free): Move declaration up.
(bitsetv_alloc, bitsetv_create): Declare that deallocation must happen
through 'bitsetv_free'.
Bruno Haible [Sat, 7 Aug 2021 17:10:38 +0000 (19:10 +0200)]
bitset: Improve GCC 11 allocation-deallocation checking.
* lib/bitset.h (bitset_free): Move declaration up.
(bitset_alloc, bitset_create): Declare that deallocation must happen
through 'bitset_free'.
(bitset_obstack_free): Move declaration up.
(bitset_obstack_alloc): Declare that deallocation must happen through
'bitset_obstack_free'.
Bruno Haible [Sat, 7 Aug 2021 17:05:31 +0000 (19:05 +0200)]
argv-iter: Improve GCC 11 allocation-deallocation checking.
* lib/argv-iter.h (argv_iter_free): Move declaration up.
(argv_iter_init_argv, argv_iter_init_stream): Declare that deallocation
must happen through 'argv_iter_free'.
Bruno Haible [Sat, 7 Aug 2021 17:00:42 +0000 (19:00 +0200)]
argp: Improve GCC 11 allocation-deallocation checking.
* lib/argp-fmtstream.h (__argp_fmtstream_free, argp_fmtstream_free):
Move declarations up.
(__argp_make_fmtstream): Declare that deallocation must happen through
'__argp_fmtstream_free'.
(argp_make_fmtstream): Declare that deallocation must happen through
'argp_fmtstream_free'.
Bruno Haible [Sat, 7 Aug 2021 16:55:45 +0000 (18:55 +0200)]
areadlink, areadlinkat: Improve GCC 11 allocation-deallocation checking.
* lib/areadlink.h: Include <stdlib.h> instead of <stddef.h>.
(areadlink, areadlink_with_size, areadlinkat, areadlinkat_with_size):
Declare that deallocation must happen through 'free'.
Bruno Haible [Sat, 7 Aug 2021 16:17:55 +0000 (18:17 +0200)]
stdio: Improve GCC 11 allocation-deallocation checking.
* lib/stdio.in.h (fdopen, fopen, tmpfile): Declare that deallocation
must happen through 'fclose'.
(popen): Declare that deallocation must happen through 'pclose'.
* lib/stdio-safer.h (fopen_safer, tmpfile_safer): Declare that
deallocation must happen through 'fclose'.
(popen_safer): Declare that deallocation must happen through 'pclose'.
(freopen_safer): Declare that arguments must be non-NULL.
Bruno Haible [Sat, 7 Aug 2021 16:05:44 +0000 (18:05 +0200)]
dirent: Improve GCC 11 allocation-deallocation checking.
* lib/dirent.in.h (closedir): Move declaration up.
(opendir, fdopendir): Declare that that deallocation must happen through
'closedir'.
* lib/dirent-safer.h (opendir_safer): Likewise.
* lib/opendirat.h (opendirat): Likewise.
Bruno Haible [Sat, 7 Aug 2021 14:40:12 +0000 (16:40 +0200)]
stdlib, string, wchar: Improve GCC 11 allocation-deallocation checking.
* lib/stdlib.in.h (free): Move declaration up.
(aligned_alloc, calloc, canonicalize_file_name, malloc, realloc):
Declare that deallocation must happen through 'free' (which may actually
be 'rpl_free').
* lib/string.in.h: Include <stdlib.h>.
(strdup): Declare deallocation.
* lib/wchar.in.h: Include <stdlib.h>.
(wcsdup): Declare deallocation.
* lib/malloc.in.h: Include <stdlib.h>.
(memalign): Declare deallocation.
Bruno Haible [Sat, 7 Aug 2021 14:03:22 +0000 (16:03 +0200)]
year2038: Fix recommendation regarding -m64 flag.
* m4/year2038.m4 (gl_YEAR2038_BODY): Recommend to put option --m64 in
CC, not in CPPFLAGS and LDFLAGS.
Bruno Haible [Sat, 7 Aug 2021 13:24:51 +0000 (15:24 +0200)]
quotearg: Tweak last commit.
* lib/quotearg.h: Don't include <stddef.h>. Remove stray semicolon.
Bruno Haible [Sat, 7 Aug 2021 13:19:33 +0000 (15:19 +0200)]
malloca: Tweak last commit.
* lib/malloca.h: Keep use and declaration of mmalloca close together.
Bruno Haible [Sat, 7 Aug 2021 13:11:43 +0000 (15:11 +0200)]
dirname-lgpl, sh-quote, system-quote, xstriconv: Clean up includes.
* lib/dirname.h: Don't include <stddef.h>.
* lib/sh-quote.h: Likewise.
* lib/system-quote.h: Likewise.
* lib/xstriconv.h: Likewise.
Bruno Haible [Sat, 7 Aug 2021 13:01:33 +0000 (15:01 +0200)]
dfa: Improve GCC 11 allocation-deallocation checking.
* lib/dfa.h (dfamust): Declare that deallocation must happen through
dfamustfree.
Paul Eggert [Fri, 6 Aug 2021 22:08:27 +0000 (15:08 -0700)]
glob: merge from glibc
* lib/glob-libc.h, lib/glob.c: Merge changes from glibc 2.34.
The result should be copyable directly into glibc.
* modules/glob-h (glob-libc.gl.h): Also omit __THROWNL.
Simon Josefsson [Wed, 4 Aug 2021 09:18:39 +0000 (11:18 +0200)]
announce-gen: Text fix suggested by Paul Eggert.
Simon Josefsson [Tue, 3 Aug 2021 19:16:33 +0000 (21:16 +0200)]
announce-gen: Text fix suggested by Jim Meyering.
Simon Josefsson [Tue, 3 Aug 2021 15:16:42 +0000 (17:16 +0200)]
maintainer-makefile: Print checksums by default.
* top/maint.mk (announcement): Drop --no-print-checksums.
Simon Josefsson [Tue, 3 Aug 2021 15:15:16 +0000 (17:15 +0200)]
announce-gen: Print SHA1/B64(SHA256) instead of MD5/SHA1.
* build-aux/announce-gen (%digest_classes): Removed.
(usage): Doc fix.
(print_checksums): Instead of MD5/SHA1, print SHA1 and
B64(SHA256), inspired by OpenSSH announcements.
Karl Berry [Tue, 3 Aug 2021 14:31:39 +0000 (07:31 -0700)]
autoupdate
Paul Eggert [Mon, 2 Aug 2021 23:49:01 +0000 (16:49 -0700)]
manywarnings: enable some malloc warnings
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Stop adding
-Wno-analyzer-double-free, -Wno-analyzer-null-dereference, and
-Wno-analyzer-use-after-free, as these false alarms don’t seem
to be as much of an issue now that we’ve pacified a couple
of individual modules and GCC has some bug fixes.
Paul Eggert [Mon, 2 Aug 2021 18:36:30 +0000 (11:36 -0700)]
dfa: omit unneeded malloc+free
Problem indirectly found by Coverity.
* lib/dfa.c (enlistnew): New function, with most of the body of
the old ‘enlist’. It assumes its arg NEW has been malloced and
can be freed eventually.
(enlist, addlists, dfamust): Use it.
(dfamust): Omit an unnecessary malloc+free.
Paul Eggert [Mon, 2 Aug 2021 16:44:59 +0000 (09:44 -0700)]
year2038: work even if time_t is narrower than int
Paul Eggert [Mon, 2 Aug 2021 16:30:50 +0000 (09:30 -0700)]
year2038: port to unusual time_t platforms
* m4/year2038.m4 (gl_YEAR2038_TEST_INCLUDES): Check that time_t
can go to 2**32 - 1, not to 2**63 - 1, as the former is enough to
be year 2038 safe. Unsigned 32-bit time_t (AmigaOS) and signed
40-bit time_t (Unisys ClearPath) have occurred in the wild, and
even if Gnulib code is rarely or never ported to them there’s no
need to exclude them merely because of year 2038 issues.
(gl_YEAR2038_BODY): Adjust messages to match. Use 2**32 - 1,
not 2**32, as the test timestamp, to allow unsigned 32-bit time_t.
Paul Eggert [Mon, 2 Aug 2021 05:27:49 +0000 (22:27 -0700)]
xalloc: no attribute (malloc (free)) on inline
The GCC manual says you can’t use __attribute__ ((__malloc__
(free, 1))) on inline functions. Problem discovered when
compiling diffutils 3.8 on RHEL 8.4 using a GCC 11.2.0 that I
built myself. Perhaps the problem was not discovered earlier
because the attribute works with ‘free’ (which is what I was
seeing before on Fedora 34) but not with ‘rpl_free’ (seen on RHEL
8.4). Anyway, the GCC manual says it shouldn’t work at all, so
don’t use it.
* lib/xalloc.h (xnmalloc, xcharalloc): No longer inline.
* lib/xmalloc.c (xcharalloc, xnmalloc): Move function bodies here.
* m4/gnulib-common.m4 (_GL_ATTRIBUTE_DEALLOC)
(_GL_ATTRIBUTE_DEALLOC_FREE): Document that these cannot be
used on inline functions, as per the GCC 11.2.1 manual.
Paul Eggert [Mon, 2 Aug 2021 00:59:05 +0000 (17:59 -0700)]
* lib/quotarg.c: remove wrong, unneeded comment
Paul Eggert [Mon, 2 Aug 2021 00:57:43 +0000 (17:57 -0700)]
sigsegv-tests: make more things static
* tests/test-sigsegv-catch-segv1.c:
* tests/test-sigsegv-catch-stackoverflow1.c:
* tests/test-sigsegv-catch-stackoverflow2.c:
Declare some functions and variables static, to pacify GCC when
warning about external functions missing declarations.
Paul Eggert [Mon, 2 Aug 2021 00:56:18 +0000 (17:56 -0700)]
manywarnings: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:52:29 +0000 (17:52 -0700)]
argmatch-tests: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:51:11 +0000 (17:51 -0700)]
vasnprintf: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:48:29 +0000 (17:48 -0700)]
xvasprintf: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:47:24 +0000 (17:47 -0700)]
xstriconv: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:46:47 +0000 (17:46 -0700)]
xreadlink: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:46:13 +0000 (17:46 -0700)]
xmalloca: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:45:24 +0000 (17:45 -0700)]
xgethostname: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:44:46 +0000 (17:44 -0700)]
xgetcwd: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:44:05 +0000 (17:44 -0700)]
trim: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:43:35 +0000 (17:43 -0700)]
system-quote: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:42:56 +0000 (17:42 -0700)]
sh-quote: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:41:59 +0000 (17:41 -0700)]
savedir: improve -fanalyzer malloc checking