summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* fchdir tests: Fix test failure on native Windows.Bruno Haible2023-04-272-0/+6
| | | | * modules/fchdir-tests (Depends-on): Add dup.
* fclose: Make last change more maintainable.Bruno Haible2023-04-266-16/+34
| | | | | | | | | | | | * m4/fclose.m4 (gl_FUNC_FCLOSE): Define through AC_DEFUN_ONCE. Don't modify REPLACE_FOPEN. * modules/fclose (Depends-on): Add comment. (configure.ac): Don't modify REPLACE_FOPEN. Don't duplicate actions of module 'fopen'. * m4/fopen.m4 (gl_FUNC_FOPEN_ITSELF): Renamed from gl_FUNC_FOPEN. (gl_FUNC_FOPEN): New macro. * modules/fopen (Files): Add m4/fclose.m4, m4/fflush.m4. * m4/close.m4 (gl_FUNC_CLOSE): Define through AC_DEFUN_ONCE.
* gnulib-tool: For conditional dependencies, generate portable sh code.Po Lu2023-04-263-2/+10
| | | | | | * gnulib-tool (func_emit_autoconf_snippets): Avoid sh syntax 'if ! variable', that does not work with Solaris /bin/sh. * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Likewise.
* expm1 tests: Avoid test failure on 32-bit mingw.Bruno Haible2023-04-262-5/+6
| | | | * tests/test-expm1.h (test_function): Mark y as 'volatile'.
* poll tests: Avoid test failure on native Windows.Bruno Haible2023-04-253-2/+10
| | | | | | | * tests/test-poll.c (test_pipe): Disable the POLLHUP check also on native Windows. * doc/posix-functions/poll.texi: Mention also native Windows w.r.t. POLLHUP.
* dfa tests: Fix compilation error (regression 2023-04-22).Bruno Haible2023-04-253-0/+8
| | | | | * tests/test-dfa-match-aux.c: Include unistd.h. * modules/dfa-tests (Depends-on): Add unistd.
* tests: Suppress ‘#pragma GCC diagnostic’ warnings with GCC < 13.Bruno Haible2023-04-259-10/+20
| | | | | | | | | | | * tests/test-localename.c: Disable #pragma for GCC < 12. * tests/test-dup2.c: Disable #pragma for GCC < 13. * tests/test-fcntl.c: Likewise. * tests/test-getdtablesize.c: Likewise. * tests/test-listen.c: Likewise. * tests/test-open.h: Likewise. * tests/test-perror2.c: Likewise. * tests/test-select.h: Likewise.
* select, pselect: Fix test failure on native Windows.Bruno Haible2023-04-243-2/+17
| | | | | * lib/select.c (rpl_select): Fail if nfds is out-of-range. * lib/pselect.c (pselect): Likewise.
* fclose: pacify gcc -Wanalyzer-file-leakPaul Eggert2023-04-243-0/+23
| | | | | | | | | | | | | | Without this patch, building coreutils with --enable-gcc-checking=expensive would fail with a message like “lib/exclude.c:682:6: error: leak of FILE 'in' [CWE-775] [-Werror=analyzer-file-leak]”, because Gnulib replaced fclose but not fopen, and GCC saw a call to fopen followed by a call to rpl_fclose. The patch causes GCC to instead see a call to rpl_fopen followed by rpl_fclose. * m4/fclose.m4 (gl_FUNC_FCLOSE): Replace fopen when replacing fclose. * modules/fclose (Depends-on): Add fopen. (configure.ac): Replace fopen when replacing fclose.
* unsetenv-tests: pacify -Wanalyzer-putenv-of-auto-varPaul Eggert2023-04-242-1/+7
| | | | | | * tests/test-unsetenv.c (main): Make entry static. Even with this change, it’s unclear whether this test is portable POSIX code, but that’s a different matter.
* tests: suppress some unwanted -fanalyzer checkingPaul Eggert2023-04-2410-0/+56
| | | | | | | | * tests/test-dup2.c, tests/test-fcntl.c, tests/test-fopen.h: * tests/test-getdtablesize.c, tests/test-listen.c: * tests/test-localename.c, tests/test-open.h, tests/test-perror2.c: * tests/test-select.h: Add pragmas to disable unwanted -fanalyzer checking.
* ftell, ftello: Fix recognition of pipes on native Windows.Bruno Haible2023-04-246-6/+38
| | | | | | | | | * m4/lseek.m4 (gl_FUNC_LSEEK): Update comment. * m4/ftello.m4 (gl_FUNC_FTELLO): On native Windows, set REPLACE_FTELLO=1 always. * doc/posix-functions/ftello.texi: Mention the behaviour on pipes. * doc/posix-functions/ftell.texi: Likewise. * doc/posix-functions/fgetpos.texi: Likewise.
* lseek: Fix module dependencies (regression 2021-11-15).Bruno Haible2023-04-242-1/+7
| | | | | * modules/lseek (Depends-on): Re-enable the msvc-nothrow dependency also when WINDOWS_64_BIT_OFF_T is 0.
* system-quote: Fix memory overrun bug on native Windows.Bruno Haible2023-04-242-1/+7
| | | | | * lib/system-quote.c (system_quote): Allocate enough space for the result.
* unicodeio tests: Avoid test failures on native Windows.Bruno Haible2023-04-243-1/+30
| | | | | | * tests/test-unicodeio.c: Include localcharset.h. (main): Handle C locales whose encoding is CP1252 or similar. * modules/unicodeio-tests (Depends-on): Add localcharset.
* *sprintf tests: Avoid test failures on mingw 10.Bruno Haible2023-04-245-8/+25
| | | | | | | | * tests/test-vasnprintf-posix.c (test_function): On newer mingw, expect the de-facto standard result. * tests/test-vasprintf-posix.c (test_function): Likewise. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise.
* Improve quoting of AS_HELP_STRING's first argument.Bruno Haible2023-04-2417-32/+54
| | | | | | | | | | | | | | | | | | | | | * m4/acl.m4 (gl_FUNC_ACL_ARG): Don't underquote AS_HELP_STRING's first argument. * m4/assert.m4 (gl_ASSERT): Likewise. * m4/gc.m4 (gl_GC): Likewise. * m4/gnulib-common.m4 (gl_COMMON_BODY): Likewise. * m4/ld-version-script.m4 (gl_LD_VERSION_SCRIPT): Likewise. * m4/lib-ld.m4 (AC_LIB_PROG_LD): Likewise. * m4/libgmp.m4 (gl_LIBGMP): Likewise. * m4/regex.m4 (gl_REGEX): Likewise. * m4/relocatable-lib.m4 (gl_RELOCATABLE_NOP): Likewise. * m4/selinux-selinux-h.m4 (gl_LIBSELINUX): Likewise. * m4/sigsegv.m4 (gl_SIGSEGV): Likewise. * m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Likewise. * m4/valgrind-tests.m4 (gl_VALGRIND_TESTS): Likewise. * m4/version-etc.m4 (gl_VERSION_ETC_FLAG): Likewise. * m4/xattr.m4 (gl_FUNC_XATTR): Likewise. * doc/manywarnings.texi (manywarnings): Likewise. This avoids the use of quadrigraphs.
* category-none: Fix link errors on MSVC, when libunistring is installed.Bruno Haible2023-04-232-3/+9
| | | | | | * modules/unictype/category-none (configure.ac): Remove gl_LIBUNISTRING_MODULE invocation. (Makefile.am): Compile unictype/categ_none.c always.
* manywarnings: use AS_IFPaul Eggert2023-04-232-6/+9
| | | | | | * m4/manywarnings.m4 (gl_MANYWARN_COMPLEMENT): Use AS_IF when the body contains Autoconf macros that could conceivably require something.
* manywarnings: update C warnings for GCC 13Paul Eggert2023-04-234-1/+48
| | | | | | | | | | Adjust for C programs compiled by GCC 13. (A C++ expert still needs to look at manywarnings-c++.m4.) * build-aux/gcc-warning.spec: Add warnings introduced in GCC 13. * doc/manywarnings.texi (manywarnings): Document flex arrays. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -fstrict-flex-arrays and -Wstrict-flex-arrays as these should be suitable for Gnulib-using code.
* manywarnings: bring doc up to datePaul Eggert2023-04-232-27/+63
| | | | * doc/manywarnings.texi: Bring doc up to date for GCC 12.
* manywarnings: omit -fno-common in GCC 10+Paul Eggert2023-04-232-3/+15
| | | | | | * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Omit -fno-common in GCC 10 and later, as it is the default there. Check exit status of ‘gcc --version’.
* libunistring: Fix build on Windows, when a libunistring is installed.Bruno Haible2023-04-23148-281/+939
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/unicase.in.h: Include <unistring/woe32dll.h>. (unicase_empty_prefix_context, unicase_empty_suffix_context): Declare with GNULIB_UNICASE_..._DLL_VARIABLE. * lib/unictype.in.h: Include <unistring/woe32dll.h>. (UC_CATEGORY_*, UC_PROPERTY_*): Declare with GNULIB_UNICTYPE_..._DLL_VARIABLE. * lib/uninorm.in.h: Include <unistring/woe32dll.h>. (unicode_normalization_form uninorm_nf*): Declare with GNULIB_UNINORM_..._DLL_VARIABLE. * m4/libunistring-base.m4 (gl_LIBUNISTRING_MODULE_WITH_VARIABLE): New macro. (gl_LIBUNISTRING_LIB_PREPARE): Set HAVE_UNISTRING_WOE32DLL_H. * m4/unicase_h.m4: New file. * m4/unictype_h.m4: New file. * m4/uninorm_h.m4: New file. * modules/unicase/base (Files): Add m4/unicase_h.m4. (configure.ac): Bump version number. Invoke gl_UNICASE_H, gl_UNICASE_H_REQUIRE_DEFAULTS. (Makefile.am): Substitute all GNULIB_UNICASE_*_DLL_VARIABLE. * modules/unicase/empty-*-context (configure.ac): Invoke gl_UNICASE_H_REQUIRE_DEFAULTS. Use gl_LIBUNISTRING_MODULE_WITH_VARIABLE. * modules/unictype/base (Files): Add m4/unictype_h.m4. (configure.ac): Bump version number. Invoke gl_UNICTYPE_H, gl_UNICTYPE_H_REQUIRE_DEFAULTS. (Makefile.am): Substitute all GNULIB_UNICTYPE_*_DLL_VARIABLE. * modules/unictype/category-* (configure.ac): Invoke gl_UNICTYPE_H_REQUIRE_DEFAULTS. Use gl_LIBUNISTRING_MODULE_WITH_VARIABLE. * modules/unictype/property-* (configure.ac): Likewise. * modules/uninorm/base (Files): Add m4/uninorm_h.m4. (configure.ac): Bump version number. Invoke gl_UNINORM_H, gl_UNINORM_H_REQUIRE_DEFAULTS. (Makefile.am): Substitute all GNULIB_UNINORM_*_DLL_VARIABLE. * modules/uninorm/nf* (configure.ac): Invoke gl_UNINORM_H_REQUIRE_DEFAULTS. Use gl_LIBUNISTRING_MODULE_WITH_VARIABLE.
* Avoid some Autoconf "was expanded before it was required" warnings.Bruno Haible2023-04-236-11/+20
| | | | | | | | * m4/locale-ar.m4 (gt_LOCALE_AR): Define through AC_DEFUN_ONCE. * m4/locale-fr.m4 (gt_LOCALE_FR, gt_LOCALE_FR_UTF8): Likewise. * m4/locale-ja.m4 (gt_LOCALE_JA): Likewise. * m4/locale-tr.m4 (gt_LOCALE_TR_UTF8): Likewise. * m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Likewise.
* string-desc tests: Avoid test failure on native Windows.Bruno Haible2023-04-224-5/+24
| | | | | | | | | * tests/test-string-desc.c: Include <fcntl.h>, <unistd.h>. (main): Expect a file name argument. Write to this file, instead of to fd 3. * tests/test-string-desc.sh: Pass a file name as argument, instead of using '3>'. * modules/string-desc-tests (Depends-on): Add close.
* threadlib, pthread-h, threads-h: Avoid mingw's libwinpthread by default.Bruno Haible2023-04-222-3/+13
| | | | | | * m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Set gl_use_winpthreads_default to 'no' by default. (gl_AVOID_WINPTHREAD): Update comments.
* posixtm tests: Avoid test failure on native Windows.Bruno Haible2023-04-222-2/+16
| | | | | * tests/test-posixtm.c (T): On native Windows, disable test cases that would fail.
* dfa tests: Fix test failure on mingw differently.Bruno Haible2023-04-224-2/+18
| | | | | | | | | Suggested by Paul Eggert. * tests/test-dfa-invalid-char-class.sh: Revert last change. * tests/test-dfa-match-aux.c: Include binary-io.h. (main): Put stdout into binary mode. * modules/dfa-tests (Depends-on): Add binary-io.
* getumask: Make it work on native Windows.Bruno Haible2023-04-203-0/+22
| | | | | | * lib/getumask.c (getumask): When TMPDIR is unset, try TMP and TEMP. * tests/test-getumask.c (ASSUME_UMASK_CONSTANT): Define to 1 on native Windows.
* posixtm tests: Fix link error.Bruno Haible2023-04-202-0/+6
| | | | * modules/posixtm-tests (Depends-on): Add stpcpy.
* readtokens tests: Fix test failure on mingw.Bruno Haible2023-04-202-3/+10
| | | | | * tests/test-readtokens.sh: Transform CRLF to LF in the output, before comparing with the expected output.
* parse-duration tests: Fix test failure on mingw.Bruno Haible2023-04-202-1/+6
| | | | | * tests/test-parse-duration.sh: Transform CRLF to LF in the output, before analyzing the output.
* dfa tests: Fix test failure on mingw.Bruno Haible2023-04-202-1/+8
| | | | | * tests/test-dfa-invalid-char-class.sh: Transform CRLF to LF in the output, before comparing with the expected output.
* Fix uses of libwinpthread on mingw 10.Bruno Haible2023-04-202-5/+12
| | | | | * m4/threadlib.m4 (gl_WEAK_SYMBOLS): On mingw, set the result to "guessing no".
* Move remaining call_once tests from mtx-tests to call_once-tests.Bruno Haible2023-04-205-164/+278
| | | | | | | | | | | | * tests/test-call_once1.c: Renamed from tests/test-call_once.c. * tests/test-call_once2.c: New file, based on tests/test-mtx.c. * tests/test-mtx.c: Remove the code that was testing call_once. * modules/call_once-tests (Files): Add test-call_once1.c, test-call_once2.c. Remove test-call_once.c. (Depends-on): Add thrd, lock, stdint. (configure.ac): Check for alarm. (Makefile.am): Test test-call_once1 instead of test-call_once. Also test test-call_once2.
* execute tests: Fix compilation error on mingw (regression 2023-01-17).Bruno Haible2023-04-202-0/+8
| | | | | * tests/test-execute-main.c (main): Don't use SIGPIPE if it's not defined.
* assert-h, verify: Fix compilation error in C++ mode with MSVC 14.30.Bruno Haible2023-04-202-5/+18
| | | | | | * lib/verify.h (_Static_assert): In C++ mode with MSVC 14.1 or newer, define merely to static_assert. (static_assert): In C++ mode with MSVC 14.1 or newer, don't define.
* chown, lchown tests: Fix link error on mingw 10.Bruno Haible2023-04-203-2/+8
| | | | | | | | * modules/chown-tests (configure.ac): Test whether getgid() exists. * modules/lchown-tests (configure.ac): Likewise. * modules/fchownat-tests (configure.ac): Likewise. * tests/test-chown.h (getgid): Define a fallback. * tests/test-lchown.h (getgid): Likewise.
* chown tests: Fix link error on mingw 10.Bruno Haible2023-04-204-2/+13
| | | | | | * modules/chown-tests (configure.ac): Test whether getgid() exists. * modules/fchownat-tests (configure.ac): Likewise. * tests/test-chown.h (getgid): Define a fallback.
* ctime: Fix compilation errors in C++ mode on mingw 10.Bruno Haible2023-04-203-1/+16
| | | | | | * lib/c++defs.h (_GL_FUNCDECL_RPL): Add a comment. * lib/time.in.h (ctime): Don't use _GL_ATTRIBUTE_DEPRECATED before _GL_FUNCDECL_RPL in C++ mode.
* random: Fix compilation errors in C++ on mingw 10.Bruno Haible2023-04-202-0/+10
| | | | | * lib/stdlib.in.h (random, srandom): Disable _GL_CXXALIASWARN invocation on non-glibc systems.
* year2038-required: Fix configure failure with MSVC.Bruno Haible2023-04-192-0/+20
| | | | | | * m4/largefile.m4 (_AC_SYS_LARGEFILE_PROBE): Distinguish the results "support not detected" and "supported through gnulib". If the result is "supported through gnulib", don't fail.
* doc: Add references to changes accepted for future POSIX revisions.Bruno Haible2023-04-1919-2/+63
| | | | | | | | | | | | | | | | | | | | | | | | * doc/glibc-functions/bind_textdomain_codeset.texi: Add reference to www.austingroupbugs.net issue. * doc/glibc-functions/bindtextdomain.texi: Likewise. * doc/glibc-functions/dcgettext.texi: Likewise. * doc/glibc-functions/dcngettext.texi: Likewise. * doc/glibc-functions/dgettext.texi: Likewise. * doc/glibc-functions/dngettext.texi: Likewise. * doc/glibc-functions/getentropy.texi: Likewise. * doc/glibc-functions/getresgid.texi: Likewise. * doc/glibc-functions/getresuid.texi: Likewise. * doc/glibc-functions/gettext.texi: Likewise. * doc/glibc-functions/ngettext.texi: Likewise. * doc/glibc-functions/posix_spawn_file_actions_addchdir_np.texi: Likewise. * doc/glibc-functions/posix_spawn_file_actions_addfchdir_np.texi: Likewise. * doc/glibc-functions/setresgid.texi: Likewise. * doc/glibc-functions/setresuid.texi: Likewise. * doc/glibc-functions/textdomain.texi: Likewise. * doc/posix-functions/asctime_r.texi: Likewise. * doc/posix-functions/ctime_r.texi: Likewise.
* wcsncmp: Add tests.Bruno Haible2023-04-193-0/+199
| | | | | | * tests/test-wcsncmp.c: New file, based on tests/unistr/test-strncmp.h and tests/test-wcscmp.c. * modules/wcsncmp-tests: New file.
* wcsncmp: Work around two ISO C compliance bugs on several platforms.Bruno Haible2023-04-198-13/+101
| | | | | | | | | | | | | * lib/wchar.in.h (wcsncmp): Consider REPLACE_WCSNCMP. * lib/wcsncmp-impl.h (wcsncmp): Don't assume that the two wide characters are in the range 0..INT_MAX. * m4/wcsncmp.m4 (gl_FUNC_WCSNCMP): Test whether wcsncmp works for all wide characters. Set REPLACE_WCSNCMP. * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WCSNCMP. * modules/wchar (Makefile.am): Substitute REPLACE_WCSNCMP. * modules/wcsncmp (Status, Notice): Un-obsolete this module. (configure.ac): Consider REPLACE_WCSNCMP. * doc/posix-functions/wcsncmp.texi: Mention the two bugs.
* wcscmp: Add tests.Bruno Haible2023-04-193-0/+138
| | | | | * tests/test-wcscmp.c: New file, based on tests/unistr/test-strcmp.h. * modules/wcscmp-tests: New file.
* wcscmp: Work around two ISO C compliance bugs on several platforms.Bruno Haible2023-04-198-13/+99
| | | | | | | | | | | | | * lib/wchar.in.h (wcscmp): Consider REPLACE_WCSCMP. * lib/wcscmp-impl.h (wcscmp): Don't assume that the two wide characters are in the range 0..INT_MAX. * m4/wcscmp.m4 (gl_FUNC_WCSCMP): Test whether wcscmp works for all wide characters. Set REPLACE_WCSCMP. * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WCSCMP. * modules/wchar (Makefile.am): Substitute REPLACE_WCSCMP. * modules/wcscmp (Status, Notice): Un-obsolete this module. (configure.ac): Consider REPLACE_WCSCMP. * doc/posix-functions/wcscmp.texi: Mention the two bugs.
* wmemcmp: Add tests.Bruno Haible2023-04-191-1/+5
| | | | * tests/test-wmemcmp.c (main): Add comment.
* wmemcmp: Add tests.Bruno Haible2023-04-193-0/+107
| | | | | * tests/test-wmemcmp.c: New file, based on tests/unistr/test-cmp.h. * modules/wmemcmp-tests: New file.
* wmemcmp: Work around ISO C compliance bug on several platforms.Bruno Haible2023-04-198-7/+87
| | | | | | | | | | | | * lib/wchar.in.h (wmemcmp): Consider REPLACE_WMEMCMP. * lib/wmemcmp-impl.h (wmemcmp): Don't assume that the two wide characters are in the range 0..INT_MAX. * m4/wmemcmp.m4 (gl_FUNC_WMEMCMP): Test whether wmemcmp works for all wide characters. Set REPLACE_WMEMCMP. * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WMEMCMP. * modules/wchar (Makefile.am): Substitute REPLACE_WMEMCMP. * modules/wmemcmp (configure.ac): Consider REPLACE_WMEMCMP. * doc/posix-functions/wmemcmp.texi: Mention the bug.