| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* lib/dfa.c (lex): Pay no attention to RE_LIMITED_OPS when
deciding how to parse '\n', since regcomp.c doesn’t.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* lib/str-two-way.h (two_way_long_needle): Pacify GCC 12.1
-Wsuggest-attribute=pure (x86-64, -O2).
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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/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”.
|
|
|
|
|
|
| |
* lib/string.in.h (free): For MSVC, add the dllimport specification if
the MSVC headers have it.
* lib/wchar.in.h (free): Likewise.
|
|
|
|
|
| |
* tests/test-glob.c: Include <fcntl.h>.
* modules/glob-tests (Depends-on): Add fcntl-h.
|
|
|
|
|
| |
* m4/termcap.m4 (gl_TERMCAP_BODY): If no suitable library is found,
set LIBTERMCAP and LTLIBTERMCAP to empty.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* lib/cdefs.h (__glibc_safe_or_unknown_len):
Use glibc’s newer version.
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
* lib/vasnprintf.c (VASNPRINTF): Coalesce cleanup code.
|
|
|
|
|
| |
* lib/vasnprintf.c (VASNPRINTF): Simplify initialization and test of
'result' variable.
|
|
|
|
|
| |
* lib/vasnprintf.c (divide): Just call
free (x) instead of doing ‘if (x != NULL) free (x);’.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
* lib/stdlib.in.h (free): Add exception specification like glibc does.
|
|
|
|
|
|
|
|
|
|
| |
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].
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* m4/gnulib-common.m4 (_GL_HAS_C_ATTRIBUTE):
Disable -Wpedantic if using __has_c_attribute and this is not C2x.
|
|
|
|
|
| |
* lib/verify.h (_GL_VERIFY): If we lack both _Static_assert and
static_assert, suppress -Wnexted-externs.
|
|
|
|
| |
* modules/gettime-res-tests, tests/test-gettime-res.c: New files.
|
| |
|
|
|
|
|
|
|
|
|
| |
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__.
|
|
|
|
|
|
|
|
| |
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'.
|
|
|
|
|
| |
* lib/string.in.h (free): Add exception specification like glibc does.
* lib/wchar.in.h (free): Likewise.
|
|
|
|
|
|
| |
* lib/string.in.h (memchr, memrchr, rawmemchr, strchrnul, strpbrk,
strstr, strcasestr): Use _GL_CXXALIASWARN1 also with clang, and add
exception specification.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
| |
* lib/mini-gmp-gnulib.c [NDEBUG]: Also use -Wunused-variable if clang.
Problem reported for Emacs by Mattias Engdegård.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* lib/glob.c (dirfd) [_LIBC]: Use #undef instead of #ifdef.
Problem reported by DJ Delorie.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|