[PATCH 13/13] xstriconv: use xwalloc rather than xalloc

2017-06-04 Thread Paul Eggert
* lib/xstriconv.c: Include xwalloc.h instead of xalloc.h. (xmem_cd_iconv, xstr_cd_iconv, xstr_iconv): Use xwalloc_die instead of xalloc_die. * modules/xstriconv (Depends-on): Remove xalloc, add xwalloc. --- ChangeLog | 6 ++ lib/xstriconv.c | 8 modules/xstriconv | 2 +- 3 f

[PATCH 01/13] walloc: new module

2017-06-04 Thread Paul Eggert
* lib/walloc.c, lib/walloc.h, modules/walloc: * modules/walloc-tests, tests/test-walloc.c: New files. --- ChangeLog| 4 ++ lib/walloc.c | 105 lib/walloc.h | 169 +++ modules/walloc

[PATCH 11/13] quotearg: use xwalloc rather than xalloc

2017-06-04 Thread Paul Eggert
* lib/quotearg.c: Include xwalloc.h instead of xalloc.h. (clone_quoting_options, quotearg_alloc_mem, nslots) (quotearg_n_options): Use ptrdiff_t rather than size_t, and xwalloc.h rather than xalloc.h functions. * modules/quotearg (Depends-on): Remove xalloc, add xwalloc. --- ChangeLog| 7

[PATCH 02/13] xwalloc, xwalloc-die, xwallocator: new modules

2017-06-04 Thread Paul Eggert
* lib/xwalloc-die.c, lib/xwalloc.c, lib/xwalloc.h, lib/xwallocator.c: * modules/xwalloc, modules/xwalloc-die, modules/xwalloc-tests: * modules/xwallocator, tests/test-xwalloc.c: New files. --- ChangeLog | 6 ++ lib/xwalloc-die.c | 46 +++ lib/xwalloc.c | 81

[PATCH 12/13] trim: use xwalloc rather than xalloc

2017-06-04 Thread Paul Eggert
* lib/trim.c: Include xwalloc.h instead of xalloc.h. (trim2): Use xwstrdup rather than strdup and xalloc_die. * modules/trim (Depends-on): Remove xalloc, add xwalloc. --- ChangeLog| 5 + lib/trim.c | 9 ++--- modules/trim | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff

[PATCH 05/13] dfa: use xwalloc instead of xalloc

2017-06-04 Thread Paul Eggert
* NEWS: Mention dfa. * lib/dfa.c: Include xwalloc.h instead of xalloc.h, intprops.h. (position, leaf_set, struct lexer_state, struct parser_state): (struct dfa, mbs_to_wchar, fetch_wc, parse_bracket_exp, struct lexptr): (lex, nsubtoks, copytoks, closure, dfaparse, copy, delete, replace): (state_ind

[PATCH 06/13] acl-permissions: use walloc

2017-06-04 Thread Paul Eggert
* lib/get-permissions.c: Include walloc.h. (get_permissions): Use wreallocarray to fix possible integer overflow. * lib/set-permissions.c: Include stdint.h, walloc.h. (set_acls_from_mode): Use wgrowalloc instead of doing it by hand, fixing a possible integer overflow. * modules/acl-permissions (Dep

[PATCH 04/13] careadlinkat: use walloc

2017-06-04 Thread Paul Eggert
* NEWS: Mention ptrdiff_t. * lib/careadlinkat.c: Include stdint.h, intprops.h, minmax.h, walloc.h. (SSIZE_MAX): Use TYPE_MAXIMUM. (careadlinkat): Accept ptrdiff_t, not size_t. Use wallocmore instead of rolling our own allocator. * lib/careadlinkat.h (careadlinkat): Accept ptrdiff_t, not size_t. * m

[PATCH 09/13] group-member: use walloc

2017-06-04 Thread Paul Eggert
* lib/group-member.c: Include walloc.h instead of xalloc-oversized. (get_group_info): Use walloc.h function instead of checking for overflow by hand. * modules/group-member: Remove xalloc-oversized. Add walloc. --- ChangeLog| 6 ++ lib/group-member.c | 7 +++ modules/group-me

[PATCH 03/13] allocator: allow reasons other than size overflow

2017-06-04 Thread Paul Eggert
* lib/allocator.h: Adjust comment to allow reasons other than size overflow to result in SIZE_MAX. --- ChangeLog | 4 lib/allocator.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2f99ccc..5aae016 100644 --- a/ChangeLog +++ b/Change

preferring ptrdiff_t to size_t for object counts

2017-06-04 Thread Paul Eggert
GNU Emacs has long been using signed types (typically ptrdiff_t) to count objects. This has the advantage that signed integer overflow can be detected automatically on some platforms (unfortunately, size_t arithmetic silently wraps around). I would like to change the Gnulib modules that GNU Emac

[PATCH 08/13] getgroups: use walloc

2017-06-04 Thread Paul Eggert
* lib/getgroups.c: Include minmax.h, walloc.h, limits.h. (rpl_getgroups): Use walloc.h functions instead of checking for overflow by hand. * modules/getgroups (Depends-on): Add minmax, walloc. Remove malloc-posix. --- ChangeLog | 7 +++ lib/getgroups.c | 24 ++--

[PATCH 10/13] propername: use xwalloc rather than xalloc

2017-06-04 Thread Paul Eggert
* lib/propername.c: Include xwalloc.h rather than xalloc.h. (proper_name, proper_name_utf8): Use xwalloc.h rather than xalloc.h functions. * modules/propername (Depends-on): Remove xalloc, add xwalloc. --- ChangeLog | 6 ++ lib/propername.c | 14 +++--- modules/propername |

[PATCH 07/13] exclude: use xwalloc instead of xalloc

2017-06-04 Thread Paul Eggert
* lib/exclude.c: Include xwalloc.h instead of walloc.h. (struct exclude_pattern, exclude_add_pattern_buffer): (new_exclude, new_exclude_segment, free_exclude_segment): (fnmatch_no_wildcards, file_pattern_matches, excluded_file_name): (add_exclude, add_exclude_fp): Use xwalloc.h rather than xalloc.h

Re: Fix for lib/same-inode.h for VMS

2017-06-04 Thread Paul Eggert
John E. Malmberg wrote: I do not know if the pragma for the assert would be valid for anything other than __DECC compiler Ah, I see. Still, I'm leery of pragmas, as I have the sneaking suspicion that they can hurt even when inside an #else that is skipped, due to problems in parsing them on

Re: Fix for lib/same-inode.h for VMS

2017-06-04 Thread John E. Malmberg
On 6/4/2017 4:32 PM, Paul Eggert wrote: John E. Malmberg wrote: VMS 8.2 and later provide a 64 bit ino_t type when _USE_STD_STAT is defined on the command line. Thanks for the heads-up. I see that 8.2 came out in 2005; I guess news travels slowly from the VMS world to the Gnulib world. The

Re: Fix for lib/same-inode.h for VMS

2017-06-04 Thread Paul Eggert
John E. Malmberg wrote: VMS 8.2 and later provide a 64 bit ino_t type when _USE_STD_STAT is defined on the command line. Thanks for the heads-up. I see that 8.2 came out in 2005; I guess news travels slowly from the VMS world to the Gnulib world. Instead of a pragma for checking, how about i