summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* autoupdateKarl Berry2022-05-251-3/+3
|
* autoupdateKarl Berry2022-05-251-1/+1
|
* dfa: new options DFA_STAR_WARN, DFA_PLUS_WARNPaul Eggert2022-05-243-17/+49
| | | | | | This lets ‘grep -E '(*a|+b)'’ warn about the * and the +. * lib/dfa.h (DFA_STAR_WARN, DFA_PLUS_WARN): New flags. * lib/dfa.c (lex): Support them.
* dfa: '\n' is not governed by RE_LIMITED_OPSPaul Eggert2022-05-232-2/+5
| | | | | * lib/dfa.c (lex): Pay no attention to RE_LIMITED_OPS when deciding how to parse '\n', since regcomp.c doesn’t.
* dfa: new option DFA_STRAY_BACKSLASH_WARNPaul Eggert2022-05-233-39/+93
| | | | | | | | | | This is for grep, which wants to warn about stray backslashes that lead to unspecified behavior. For example, "grep -oi '\a'" surprisingly is not equivalent to "grep -oi 'a'", so the stray backslash should be warned about. * lib/dfa.c: Include wctype.h, for iswprint and iswspace. (lex): Add support for DFA_STRAY_BACKSLASH_WARN. * lib/dfa.h (DFA_STRAY_BACKSLASH_WARN): New constant.
* dfa: new option DFA_CONFUSING_BRACKETS_ERRORPaul Eggert2022-05-233-8/+21
| | | | | | | | | This is for grep, which wants [:alpha:] to be an error at the top level. * lib/dfa.c (struct regex_syntax): New member dfaopts, replacing anchor. All uses changed. (parse_bracket_exp): Error, not warn, if DFA_CONFUSING_BRACKETS_ERROR. * lib/dfa.h (DFA_CONFUSING_BRACKETS_ERROR): New constant.
* strstr-simple: pacify GCC 12.1Paul Eggert2022-05-212-2/+8
| | | | | * lib/str-two-way.h (two_way_long_needle): Pacify GCC 12.1 -Wsuggest-attribute=pure (x86-64, -O2).
* dfa: steer cleer of POSIX-reserved symbolsPaul Eggert2022-05-202-10/+17
| | | | | | * lib/dfa.c (str_eq): Rename from streq. All uses changed. (c_isdigit): Rename from isasciidigit. The function worked in EBCDIC so it wasn’t ASCII-specific anyway. All uses changed.
* autoupdateKarl Berry2022-05-204-4/+4
|
* parse-datetime: support 'J' military time zonePaul Eggert2022-05-174-4/+34
| | | | | | | | | | Requested by Brian Inglis in: https://savannah.gnu.org/support/?110644 * lib/parse-datetime.y (parser_control): New member J_zones_seen. (item): New item 'J'. (military_table): Add 'J'. (parse_datetime_body): Set and use J_zones_seen. * tests/test-parse-datetime.c (main): Test "J".
* doc: remove Emacs-specific documentation; match codeReuben Thomas2022-05-152-114/+58
| | | | | | | | | * doc/regex.texi: Remove mention of both Emacs and non-Emacs syntax tables, as these are no longer supported by the code. Document the word character class (alnum + _). Add documentation for \s and \S. Replace mentions of #defining emacs with RE_NO_GNU_OPS (which takes effect in the opposite sense); merge the node “GNU Emacs Operators” into “GNU Operators”. For \` and \', refer to the “whole string” rather than the (Emacs) “buffer”.
* string, wchar: Fix compilation error on MSVC (regression 2021-09-07).Bruno Haible2022-05-153-8/+31
| | | | | | * lib/string.in.h (free): For MSVC, add the dllimport specification if the MSVC headers have it. * lib/wchar.in.h (free): Likewise.
* glob tests: Fix a warning (regression from 2022-03-23).Bruno Haible2022-05-143-0/+8
| | | | | * tests/test-glob.c: Include <fcntl.h>. * modules/glob-tests (Depends-on): Add fcntl-h.
* termcap: Fix link error when no suitable library is found.Bruno Haible2022-05-142-1/+12
| | | | | * m4/termcap.m4 (gl_TERMCAP_BODY): If no suitable library is found, set LIBTERMCAP and LTLIBTERMCAP to empty.
* dfa: fix bug with ‘.’ and UTF-8 Hangul SyllablesPaul Eggert2022-05-133-2/+29
| | | | | | | | | | | | | | | This fixes a bug introduced in 2019-12-18T05:41:27Z!eggert@cs.ucla.edu, an earlier patch that fixed dfa.c to not match invalid UTF-8. Unfortunately that patch had a couple of typos when dfa.c is matching against the regular expression ‘.’ (dot). One typo caused dfa.c to incorrectly reject the valid UTF-8 sequences (ED)(90-9F)(80-BF) corresponding to U+D400 through U+D7FF, which are some Hangul Syllables and Hangul Jamo Extended-B. The other typo caused dfa.c to incorrectly reject the valid sequences (F4)(88-8F)(80-BF)(80-BF) which correspond to U+108000 through U+10FFFF (Supplemental Private Use Area plane B). * lib/dfa.c (utf8_classes): Fix typos. * tests/test-dfa-match.sh: Test the fix.
* manywarnings: update C warnings for GCC 12Paul Eggert2022-05-123-1/+37
| | | | | | | | | Adjust for C programs compiled by GCC 12. (A C++ expert still needs to look at manywarnings-c++.m4.) * build-aux/gcc-warning.spec: Add warnings introduced in GCC 12. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wbidi-chars=any,ucn and -Wuse-after-free=3. Although not enabled by -Wall or -Wextra they seem suitable for Gnulib-using C code.
* parse-datetime: remove Emacs cruftPaul Eggert2022-05-112-10/+7
| | | | | | * lib/parse-datetime.y: Remove an ‘ifdef emacs’. Emacs has never used this module. The module is derived from code taken from Emacs, but that code was removed from Emacs in the 1990s.
* alloca: Remove old code for Emacs, unused since 2009.Bruno Haible2022-05-112-35/+7
| | | | | | | Reported by Reuben Thomas <rrt@sc3d.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2022-05/msg00032.html>. * lib/alloca.c: Remove Emacs specific code.
* Say that it is not the old interfacePaul Eggert2022-05-091-0/+3
|
* autoupdateKarl Berry2022-05-091-8/+19
|
* libc-config: update to match cdefsPaul Eggert2022-05-052-0/+20
| | | | | | | | | | * lib/libc-config.h (__attribute_alloc_align__) (__attribute_maybe_unused, __fortified_attr_access) (__glibc_fortify, __glibc_fortify_n, __glibc_likely) (__glibc_safe_len_cond, __glibc_safe_or_unknown_len) (__glibc_unsafe_len, __glibc_unsigned_or_positive, __wur): Undef these too, since lib/cdefs.h now defines them unconditionally.
* cdefs: merge from glibcPaul Eggert2022-05-052-6/+12
| | | | | * lib/cdefs.h (__glibc_safe_or_unknown_len): Use glibc’s newer version.
* gettime-res: help the compilerPaul Eggert2022-05-022-5/+10
| | | | | | * lib/gettime-res.c (gettime_res): Pacify GCC versions that incorrectly complain about earlier.tv_sec not being initialized. Let GCC know that gcd args are always positive.
* af_alg: port to Ubuntu 22.04Paul Eggert2022-05-026-0/+33
| | | | | | | | | | | | | | | | | Without this patch, maintainer builds of coreutils fail on Ubuntu 22.04 with diagnostics like "./lib/gl_openssl.h:79:1: error: 'MD5_Init' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]". From <https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes> it appears that Gnulib needs to either define OPENSSL_API_COMPAT to a version less than 3.0, or use a compatibility layer, or assume OpenSSL 1.1.0 or later. The simplest workaround is to define OPENSSL_API_COMPAT for 1.1.1, the oldest OpenSSL release still supported. A better fix would be to rewrite the code to assume OpenSSL 1.1.1 or later, and stop using the older API. * lib/md5.h, lib/sha1.h, lib/sha256.h, lib/sha512.h, lib/sm3.h: Define OPENSSL_API_COMPAT to 0x10101000L to suppress the deprecation warnings on Ubuntu 22.04.
* vasnprintf: Simplify. Reduce binary code size.Paul Eggert2022-05-012-170/+50
| | | | * lib/vasnprintf.c (VASNPRINTF): Coalesce cleanup code.
* vasnprintf: Simplify 'result' variable.Paul Eggert2022-05-012-32/+29
| | | | | * lib/vasnprintf.c (VASNPRINTF): Simplify initialization and test of 'result' variable.
* vasnprintf: Simplify a free() call.Paul Eggert2022-05-012-2/+7
| | | | | * lib/vasnprintf.c (divide): Just call free (x) instead of doing ‘if (x != NULL) free (x);’.
* string: Avoid syntax error on glibc systems with GCC 11.Bruno Haible2022-04-302-2/+12
| | | | | | | | | | Reported by Tom Tromey <tromey@adacore.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2022-04/msg00075.html> and by Satadru Pramanik <satadru@umich.edu> in <https://lists.gnu.org/archive/html/bug-gnulib/2022-04/msg00076.html>. * lib/string.in.h (strndup): Don't rededeclare strndup if it is defined as a macro.
* stdlib: Fix error in C++ mode on glibc systems (regr. 2022-04-13).Simon Marchi2022-04-292-0/+9
| | | | * lib/stdlib.in.h (free): Add exception specification like glibc does.
* glob: improve config and test cleanupPaul Eggert2022-04-283-3/+19
| | | | | | | | | | Config problem reported by Benno Schulenberg in: https://lists.gnu.org/r/bug-gnulib/2022-04/msg00071.html * m4/glob.m4 (gl_GLOB): Clean up temporary file. Also, name it conf$$-file not conf-file, so it’s cleaned up on interrupt. * modules/glob-tests (MOSTLYCLEANFILES): Append test-glob.tglobfile, test-glob.tgloblink[123].
* Fix ChangeLog typoPaul Eggert2022-04-261-1/+1
|
* glob: port to NetBSD 9.2Paul Eggert2022-04-263-5/+18
| | | | | | | | | | Problem reported by Benno Schulenberg in: https://lists.gnu.org/r/bug-gnulib/2022-04/msg00052.html * doc/posix-functions/dirfd.texi: Document NetBSD 9.2 portability bugs. Remove an old common about errno that is no longer true of POSIX 2018. * lib/glob.c (glob_in_dir): Convert dirfd arg from void * to DIR * before passing it to dirfd.
* regex: match [...---...] like V7 grepPaul Eggert2022-04-212-3/+22
| | | | | | | | Problem reported by Arnold Robbins in: https://bugs.gnu.org/20657 https://lists.gnu.org/r/bug-gnulib/2022-04/msg00053.html * lib/regcomp.c (peek_token_bracket): Let [...---...] match '-'. This is an extension to POSIX, and matches V7 Unix grep.
* backupfile: fix bug when renaming simple backupsPaul Eggert2022-04-202-4/+8
| | | | | | * lib/backupfile.c (backupfile_internal): Fix bug when RENAME and when doing simple backups. Problem reported by Steve Ward in: https://bugs.gnu.org/55029
* gettime-res: more-robust samplingPaul Eggert2022-04-202-2/+24
| | | | | | * lib/gettime-res.c (gettime_res): If adjacent timestamps are identical search for a differing timestamp. Also, stop collecting samples thereafter since they surely won’t help.
* Port _GL_HAS_C_ATTRIBUTE to pedantic gcc -std=c99Paul Eggert2022-04-192-1/+9
| | | | | * m4/gnulib-common.m4 (_GL_HAS_C_ATTRIBUTE): Disable -Wpedantic if using __has_c_attribute and this is not C2x.
* verify: port to pedantic gcc -std=c99Paul Eggert2022-04-192-0/+7
| | | | | * lib/verify.h (_GL_VERIFY): If we lack both _Static_assert and static_assert, suppress -Wnexted-externs.
* gettime-res: add testsPaul Eggert2022-04-193-0/+106
| | | | * modules/gettime-res-tests, tests/test-gettime-res.c: New files.
* autoupdateKarl Berry2022-04-191-0/+1
|
* verify: port to Mac OS 10.7.5Paul Eggert2022-04-162-1/+11
| | | | | | | | | Mac OS 10.7.5 clang sets __clang_major__ to 4 even though it was derived from Clang 3.2. Problem reported by Werner Lemberg in: https://lists.gnu.org/r/emacs-devel/2022-04/msg00779.html * lib/verify.h (_GL_HAVE__STATIC_ASSERT): Don’t define to 1 when __clang_major__ == 4 && !__cplusplus && __STDC_VERSION__ < 201112L && !defined __STRICT_ANSI__.
* sigsegv: Fix compilation error on arceb CPUs.Bruno Haible2022-04-162-2/+10
| | | | | | | | Reported by Fabrice Fontaine <fontaine.fabrice@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2022-04/msg00028.html>. * m4/stack-direction.m4 (SV_STACK_DIRECTION): Treat the 'arc' variants like 'arc'.
* string, wchar: Fix error in C++ mode on glibc systems with clang.Bruno Haible2022-04-143-0/+22
| | | | | * lib/string.in.h (free): Add exception specification like glibc does. * lib/wchar.in.h (free): Likewise.
* string: Fix errors in C++ mode on glibc systems with clang.Bruno Haible2022-04-142-21/+39
| | | | | | * lib/string.in.h (memchr, memrchr, rawmemchr, strchrnul, strpbrk, strstr, strcasestr): Use _GL_CXXALIASWARN1 also with clang, and add exception specification.
* math: Fix errors in C++ mode on glibc systems with clang.Bruno Haible2022-04-133-0/+24
| | | | | | | | | | | * lib/math.in.h (GNULIB_NAMESPACE_LACKS_ISFINITE, GNULIB_NAMESPACE_LACKS_ISINF, GNULIB_NAMESPACE_LACKS_ISNAN, GNULIB_NAMESPACE_LACKS_SIGNBIT): New macros. * tests/test-math-c++.cc (isfinite): Skip test if GNULIB_NAMESPACE_LACKS_ISFINITE is 1. (isinf): Skip test if GNULIB_NAMESPACE_LACKS_ISINF is 1. (isnan): Skip test if GNULIB_NAMESPACE_LACKS_ISNAN is 1. (signbit): Skip test if GNULIB_NAMESPACE_LACKS_SIGNBIT is 1.
* autoupdateKarl Berry2022-04-101-22/+22
|
* libgmp: pacify Clang tooPaul Eggert2022-04-082-1/+8
| | | | | * lib/mini-gmp-gnulib.c [NDEBUG]: Also use -Wunused-variable if clang. Problem reported for Emacs by Mattias Engdegård.
* init.sh: don’t assume gzipPaul Eggert2022-04-042-19/+34
| | | | | | | | | * tests/init.sh (rand_bytes_): Don’t assume gzip is installed. I found this while testing gzip installation on a platform where I had removed the installed gzip. gzip is executed only on platforms lacking mktemp and /dev/urandom so this code is rarely used; however, these platforms might also lack gzip since gzip is neither specified by POSIX or required by the GNU Coding Standards.
* glob: sync better with glibcPaul Eggert2022-03-302-3/+8
| | | | | * lib/glob.c (dirfd) [_LIBC]: Use #undef instead of #ifdef. Problem reported by DJ Delorie.
* glob: test for glibc bug 25659Paul Eggert2022-03-233-2/+53
| | | | | | https://sourceware.org/bugzilla/show_bug.cgi?id=25659 * m4/glob.m4 (gl_GLOB): Replace glob if it has bug 25659. * tests/test-glob.c (main): Test for glibc bug 25659.
* glob: fix symlink and // issues; improve speedPaul Eggert2022-03-233-38/+60
| | | | | | | | | | | | | | | | * lib/glob.c: Include fcntl.h. (dirfd) [_LIBC]: New macro. (GLOB_STAT64, GLOB_LSTAT64): Remove. Replace all uses with ... (GLOB_FSTATAT64): ... this new macro. (glob_in_dir): Treat DT_LNK like DT_UNKNOWN. Use directory-relative fstatat unless GLOB_ALTDIRFUNC, or dirfd fails. Avoid duplicate strlen (directory). Work even if directory is "/", without turning it into "//". Use a scratch buffer instead of by-hand alloca stuff. Use mempcpy and memcpy instead of stpcpy and strcpy. * modules/glob (Depends-on): Add dirfd, fstatat. Remove stat. (License): Change from LGPLv2+ to GPL, since it depends on fstatat.