]> Savannah Git Hosting - gnulib.git/commit
regex: make it closer to libc
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 19 Feb 2016 17:27:41 +0000 (09:27 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 19 Feb 2016 17:37:33 +0000 (09:37 -0800)
commitf97745b0f632a9ddae3e48cec083dd71099d37c2
treedb31b8cd3b57133c17a352ebc567b1191f820e54
parentdf5ed01e820a4b46cb4c91228cf1a54b90a4472b
regex: make it closer to libc

Make Idx a signed type, rather than possibly unsigned.
The unsignedness was not really buying us anything, since the code
overflows for other reasons before getting to PTRDIFF_MAX.  Making
it signed allows us to use -1 and -2 with abandon, like libc does,
thus lessening the number of differences between gnulib and libc.
Also, it should help avoid gratuitous warnings like the one
reported by Nelson H. F. Beebe in: http://bugs.gnu.org/22702
* lib/regex.h (__re_idx_t): Remove.  All uses changed to regoff_t.
* lib/regex_internal.h (SSIZE_MAX): Define if <limits.h> doesn't.
(IDX_MAX) [_REGEX_LARGE_OFFSETS]: Now SSIZE_MAX.
(REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
Remove.  Revert all uses to their libc versions.
ChangeLog
lib/regcomp.c
lib/regex.h
lib/regex_internal.c
lib/regex_internal.h
lib/regexec.c