summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* file-has-acl: improve port to Fedora 39Paul Eggert2023-05-151-11/+26
| | | | | | | | | | | | Problem reported by Ondrej Valousek in: https://lists.gnu.org/r/bug-gnulib/2023-05/msg00078.html * lib/file-has-acl.c: Include minmax.h. [USE_ACL && HAVE_LINUX_XATTR_H && HAVE_LISTXATTR]: Include stdckdint.h. (file_has_acl) [USE_ACL && HAVE_LINUX_XATTR_H && HAVE_LISTXATTR]: If the file has NFSv4 ACLs, ignore any POSIX ACLs, for Fedora 39. Return a bit faster when listxattr returns 0. Don’t loop forever if an attacker is fiddling with ACLs. * modules/file-has-acl (Depends-on): Add minmax, stdckdint.
* gettimeofday, pthread-*, thread, thrd: Don't omit intended initializers.Bruno Haible2023-05-156-13/+39
| | | | | | | | | | | | | | | | * lib/gettimeofday.c (gettimeofday): List the initializers of both tv_sec and tv_usec. * lib/glthread/thread.c (gl_thread_self): List the initializers of both tv_sec and tv_nsec. * lib/pthread-cond.c (pthread_cond_wait): Likewise. * lib/thrd.c (rpl_thrd_current): Likewise. * lib/pthread-rwlock.c (MIN): New macro. (pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock): List the initializers of both tv_sec and tv_nsec. Don't modify the duration after having initialized it. * lib/pthread_mutex_timedlock.c (MIN): New macro. (pthread_mutex_timedlock): List the initializers of both tv_sec and tv_nsec. Don't modify the duration after having initialized it.
* select: Fix compilation error (regression from yesterday).Bruno Haible2023-05-151-1/+1
| | | | * lib/select.c (rpl_select): Revert last change.
* poll: Fix syntax error (regression from yesterday).Bruno Haible2023-05-151-1/+1
| | | | * lib/poll.c (poll): Remove semicolon inside braces.
* timespec: fill in other membersPaul Eggert2023-05-1419-101/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This problem was found when compiling GNU Emacs with --enable-gcc-warnings on a platform where tv_sec is 64 bits and tv_nsec is 32 bits, and struct timespec has padding. GCC -Wuse-of-uninitialized-value complained when a struct timespec initialized only via assigning to tv_sec and tv_nsec was copied via assignment (this was in lib/timespec.h’s make_timespec). Although behavior is well-defined on this platform, the warning is annoying and the behavior might not be well-defined on theoretical platforms where struct timespec has other members. To work around this, initialize all the struct’s members. * lib/getsockopt.c (rpl_getsockopt): * lib/gettime.c (gettime): * lib/gettimeofday.c (gettimeofday): * lib/glthread/thread.c (gl_thread_self): * lib/nanosleep.c (nanosleep): * lib/parse-datetime.y (digits_to_date_time, set_hhmmss) (signed_seconds, unsigned_seconds, yylex, parse_datetime_body): * lib/poll.c (poll): * lib/pselect.c (pselect): * lib/pthread-cond.c (endlessly, pthread_cond_timedwait): * lib/pthread-rwlock.c (pthread_rwlock_timedrdlock) (pthread_rwlock_timedwrlock): * lib/pthread_mutex_timedlock.c (pthread_mutex_timedlock): * lib/select.c (rpl_select): * lib/settime.c (settime): * lib/stat-time.h (get_stat_atime, get_stat_ctime) (get_stat_mtime, get_stat_birthtime): * lib/thrd.c (rpl_thrd_current): * lib/timespec.h (make_timespec): * lib/timespec_getres.c (timespec_getres): * lib/utimecmp.c (utimecmpat): * lib/utimens.c (fdutimens): When filling in a struct timespec or similar time-related structure that might be copied elsewhere, also assign to any storage other than tv_sec and tv_nsec, to avoid undefined behavior on (likely theoretical) platforms where struct timespec has other members, and also to avoid warnings from GCC and/or valgrind.
* stdio: use _GL_ATTRIBUTE_MALLOCPaul Eggert2023-05-131-11/+31
| | | | | | | | | | | | | * lib/stdio.in.h (fdopen, fopen, popen, tmpfile): Declare with _GL_ATTRIBUTE_MALLOC, for consistency with glibc, and so that building the fopen module with ‘gcc -O2 -Wsuggest-attribute=malloc -Wsystem-headers -Werror’ does not fail with “stdio.h: In function ‘rpl_fopen’: stdio.h:970:1: error: function might be candidate for attribute ‘malloc’ [-Werror=suggest-attribute=malloc]”, a problem I noticed on both Fedora 38 and Ubuntu 23.04. sigsegv: Add tentative support for Hurd/x86_64. Reported by Samuel Thibault <samuel.thibault@ens-lyon.org>.
* sigsegv: Add tentative support for Hurd/x86_64.Bruno Haible2023-05-121-3/+17
| | | | | | Reported by Samuel Thibault <samuel.thibault@ens-lyon.org>. * lib/sigsegv.c: Update from libsigsegv/src/fault-hurd-i386.h.
* file-has-acl: don’t access freed storagePaul Eggert2023-05-121-1/+3
| | | | | Fix typo in previous patch, by not accessing freed storage in the unusual case where the statck buffer is not large enough.
* file-has-acl: port to Fedora 39Paul Eggert2023-05-121-27/+67
| | | | | | | | | | | | | | | | | | | | | Fedora 39 getxattr with XATTR_NAME_POSIX_ACL_ACCESS either succeeds or fails with ENODATA, so it is no longer possible to detect from its failure that the filesystem might support NFSv4 ACLs. Problem reported by Ondrej Valousek in: https://lists.gnu.org/r/bug-gnulib/2023-04/msg00228.html Instead, use listxattr to determine whether NFSv4 ACLs are in play. This typically saves syscalls anyway. * lib/file-has-acl.c: In #if, use (HAVE_LINUX_XATTR_H && HAVE_LISTXATTR) instead of GETXATTR_WITH_POSIX_ACLS. The following changes apply when (USE_ACL && HAVE_LINUX_XATTR_H && HAVE_LISTXATTR): Include minmax.h. (have_xattr): New function. (file_has_acl): Try listxattr first; typically this means we need to do no other syscall. Call getxattr only if there are NFSv4 ACLs but not POSIX ACLs. * m4/acl.m4 (gl_FILE_HAS_ACL): Simplify by merely testing for linux/xattr.h and listxattr. All uses changed.
* c32swidth: New module.Bruno Haible2023-05-044-7/+72
| | | | | | | | | | | | * lib/uchar.in.h (c32swidth): New declaration. * lib/wcswidth-impl.h: Use macros FUNC, UNIT, CHARACTER_WIDTH. * lib/wcswidth.c: Define FUNC, UNIT, CHARACTER_WIDTH before including wcswidth-impl.h. * lib/c32swidth.c: New file. * modules/c32swidth: New file. * m4/uchar_h.m4 (gl_UCHAR_H_REQUIRE_DEFAULTS): Initialize GNULIB_C32SWIDTH. * modules/uchar (Makefile.am): Substitute GNULIB_C32SWIDTH.
* wcswidth: Fix result in case of overflow.Bruno Haible2023-05-041-3/+16
| | | | | * lib/wcswidth-impl.h (wcswidth): Continue searching for a non-printing wide character after the total width has become > INT_MAX.
* wcswidth: Relax license.Bruno Haible2023-05-042-2/+2
| | | | | | * modules/wcswidth (License): Change to LGPLv2+. * lib/wcswidth.c: Update license notice. * lib/wcswidth-impl.h: Likewise.
* c32width: Relax license.Bruno Haible2023-05-041-16/+8
| | | | | * modules/c32width (License): Change to LGPLv2+. * lib/c32width.c: Update license notice.
* c32to*: Relax license.Bruno Haible2023-05-043-48/+24
| | | | | | | | * modules/c32tolower (License): Change to LGPLv2+. * modules/c32toupper (License): Likewise. * lib/c32tolower.c: Update license notice. * lib/c32toupper.c: Likewise. * lib/c32to-impl.h: Likewise.
* unicase/tolower, unicase/toupper: Relax license.Bruno Haible2023-05-046-84/+46
| | | | | | | | | | | | * lib/gen-uni-tables.c (output_simple_mapping): Bump copyright year. For unicase/tolower.h and unicase/toupper.h, use the LGPLv2+. * lib/unicase/tolower.h: Regenerated. * lib/unicase/toupper.h: Likewise. * lib/unicase/simple-mapping.h: Update license notice. * lib/unicase/tolower.c: Likewise. * lib/unicase/toupper.c: Likewise. * modules/unicase/tolower (License): Change to LGPLv2+. * modules/unicase/toupper (License): Likewise.
* unicase/base: Relax license.Bruno Haible2023-05-041-16/+8
| | | | | * modules/unicase/base (License): Change to LGPLv2+. * lib/unicase.in.h: Update license notice.
* c32is*: Relax license.Bruno Haible2023-05-0413-208/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/c32isalnum (License): Change to LGPLv2+. * modules/c32isalpha (License): Likewise. * modules/c32isblank (License): Likewise. * modules/c32iscntrl (License): Likewise. * modules/c32isdigit (License): Likewise. * modules/c32isgraph (License): Likewise. * modules/c32islower (License): Likewise. * modules/c32isprint (License): Likewise. * modules/c32ispunct (License): Likewise. * modules/c32isspace (License): Likewise. * modules/c32isupper (License): Likewise. * modules/c32isxdigit (License): Likewise. * lib/c32isalnum.c: Update license notice. * lib/c32isalpha.c: Likewise. * lib/c32isblank.c: Likewise. * lib/c32iscntrl.c: Likewise. * lib/c32isdigit.c: Likewise. * lib/c32isgraph.c: Likewise. * lib/c32islower.c: Likewise. * lib/c32isprint.c: Likewise. * lib/c32ispunct.c: Likewise. * lib/c32isspace.c: Likewise. * lib/c32isupper.c: Likewise. * lib/c32isxdigit.c: Likewise. * lib/c32is-impl.h: Likewise.
* unictype/ctype-*: Relax license.Bruno Haible2023-05-0425-397/+206
| | | | | | | | | | | | | | | | | | | * lib/gen-uni-tables.c (output_predicate): Bump copyright year. For unictype/ctype_*, use the LGPLv2+. * lib/unictype/ctype_*.h: Regenerated. * lib/unictype/ctype_*.c: Update license notice. * modules/unictype/ctype-alnum (License): Change to LGPLv2+. * modules/unictype/ctype-alpha (License): Likewise. * modules/unictype/ctype-blank (License): Likewise. * modules/unictype/ctype-cntrl (License): Likewise. * modules/unictype/ctype-digit (License): Likewise. * modules/unictype/ctype-graph (License): Likewise. * modules/unictype/ctype-lower (License): Likewise. * modules/unictype/ctype-print (License): Likewise. * modules/unictype/ctype-punct (License): Likewise. * modules/unictype/ctype-space (License): Likewise. * modules/unictype/ctype-upper (License): Likewise. * modules/unictype/ctype-xdigit (License): Likewise.
* c32width: New module.Bruno Haible2023-05-042-0/+120
| | | | | | | | | * lib/uchar.in.h (c32width): New declaration. * lib/c32width.c: New file, based on lib/c32is-impl.h. * modules/c32width: New file. * m4/uchar_h.m4 (gl_UCHAR_H_REQUIRE_DEFAULTS): Initialize GNULIB_C32WIDTH. * modules/uchar (Makefile.am): Substitute GNULIB_C32WIDTH.
* vasnprintf, vasnwprintf: Make '0' flag handling more ISO C compliant.Bruno Haible2023-05-031-5/+20
| | | | | | | | | | | | * lib/vasnprintf.c (VASNPRINTF): When doing the padding ourselves, ignore the '0' flag if a precision is specified and the conversion is one of d, i, o, u, x, X, b, B. * tests/test-vasnprintf-posix.c (test_function): Update expected results accordingly. * tests/test-vasprintf-posix.c (test_function): Likewise. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasnwprintf-posix.c (test_function): Likewise.
* mktime: include <intprops.h>Paul Eggert2023-05-021-0/+1
| | | | | | * lib/mktime.c: Include <intprops.h> again, fixing a typo noted by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2023-05/msg00014.html
* fopen: Silence a gcc warning.Bruno Haible2023-05-021-0/+4
| | | | * lib/fopen.c (rpl_fopen): Mark open_direction as used.
* regex: prefer C23 style overflow checkingPaul Eggert2023-05-012-1/+2
| | | | | | | * lib/regex_internal.h: Include stdckdint.h. * lib/regexec.c (re_search_2_stub): * modules/regex (Depends-on): Add stdckdint. Prefer stdckdint.h to intprops.h macros.
* dynarray: prefer C23 style overflow checkingPaul Eggert2023-05-012-4/+4
| | | | | | | | | | | * lib/malloc/dynarray_emplace_enlarge.c, lib/malloc/dynarray_resize.c: Include stdckdint.h, not intprops.h. * lib/malloc/dynarray_emplace_enlarge.c: (__libc_dynarray_emplace_enlarge): * lib/malloc/dynarray_resize.c (__libc_dynarray_resize): Prefer stdckdint.h to intprops.h macros. * modules/glibc-internal/dynarray (Depends-on): Depend on stdckdint, not intprops.
* mktime: prefer C23 style overflow checkingPaul Eggert2023-05-011-6/+6
| | | | | | | | | Prefer stdckdint.h macros to intprops.h macros where either will do, as this is the C23 standard. Also, it ports around a pcc bug. * config/srclist.txt: Comment out mktime.c. * lib/mktime.c: Include stdckdint.h, not intprops.h. (__mktime_internal): Prefer stdckdint.h to intprops.h macros. * modules/mktime (Depends-on): Add stdckdint.
* limits-h: port to pccPaul Eggert2023-05-011-0/+5
| | | | | | | * doc/posix-headers/limits.texi: Document the issue. * lib/limits.in.h (MB_LEN_MAX): New macro, if not already defined. * m4/limits-h.m4 (gl_LIMITS_H): Test for MB_LEN_MAX. * tests/test-limits-h.c: Check that it’s positive.
* localeconv: Work around a mingw bug.Bruno Haible2023-04-281-17/+28
| | | | | | | | | | * m4/localeconv.m4 (gl_FUNC_LOCALECONV): Test whether fields of type 'char' are filled correctly. (gl_PREREQ_LOCALECONV): Test whether 'struct lconv' has the int_{p,n}_* members. * lib/localeconv.c (FIX_CHAR_VALUE): New macro. (localeconv): Replace negative field values with CHAR_MAX. * doc/posix-functions/localeconv.texi: Mention the mingw bug.
* freopen-safer: pacify GCC 13Paul Eggert2023-04-261-0/+5
| | | | * lib/freopen-safer.c: Ignore -Wanalyzer-fd-leak.
* fdopendir: Fix fd leak and test failure on native Windows.Bruno Haible2023-04-279-66/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/dirent-private.h: On mingw, define 'struct gl_directory' as a wrapper around the original DIR. On MSVC, add an 'fd_to_close' field to 'struct gl_directory'. * lib/dirent.in.h (DIR): Define when DIR_HAS_FD_MEMBER is 0, i.e. on both mingw and MSVC. (GNULIB_defined_DIR): New macro. (opendir): Avoid incompatible redeclaration. (readdir): Consider REPLACE_READDIR. (rewinddir): Consider REPLACE_REWINDDIR. * m4/dirent_h.m4 (gl_DIRENT_DIR): New macro. (gl_DIRENT_H): Invoke it. (gl_DIRENT_H_DEFAULTS): Initialize REPLACE_READDIR, REPLACE_REWINDDIR. * modules/dirent (Makefile.am): Substitute DIR_HAS_FD_MEMBER, REPLACE_READDIR, REPLACE_REWINDDIR. -- * lib/dirfd.c (dirfd): If GNULIB_defined_DIR, just use the 'fd_to_close' field. * m4/dirfd.m4 (gl_FUNC_DIRFD): Set HAVE_DIRFD. Don't set REPLACE_DIRFD to 1 if HAVE_DIRFD is 0. If DIR_HAS_FD_MEMBER is 0, ensure dirfd.c gets compiled. * modules/dirfd (Files): Add lib/dirent-private.h. (Depends-on, configure.ac): Simplify conditions. -- * lib/closedir.c: Include <stdlib.h> always, for free(). (closedir): If GNULIB_defined_DIR, arrange to call close(dirfd(dirp)) at the end. On mingw, call free() of dirp. Prefer testing HAVE_DIRENT_H, for consistency with dirent.h. * m4/closedir.m4 (gl_FUNC_CLOSEDIR): Don't set REPLACE_CLOSEDIR to 1 if HAVE_CLOSEDIR is 0. If DIR_HAS_FD_MEMBER is 0, ensure closedir.c gets compiled. -- * lib/opendir.c: Include <stdlib.h> always. Include <string.h>. (opendir): On mingw, allocate the 'struct gl_directory' through malloc. If GNULIB_defined_DIR, set the 'fd_to_close' field to -1. Prefer testing HAVE_DIRENT_H, for consistency with dirent.h. * m4/opendir.m4 (gl_FUNC_OPENDIR): Don't set REPLACE_OPENDIR to 1 if HAVE_OPENDIR is 0. If DIR_HAS_FD_MEMBER is 0, ensure opendir.c gets compiled. -- * lib/fdopendir.c (fdopendir): If GNULIB_defined_DIR, use a simple implementation based on opendir and the fchdir module. If __KLIBC__, don't define unused auxiliary functions. * modules/fdopendir (Files): Add lib/dirent-private.h. -- * lib/readdir.c (readdir): On mingw, redirect to the original readdir function. Prefer testing HAVE_DIRENT_H, for consistency with dirent.h. * m4/readdir.m4 (gl_FUNC_READDIR): If DIR_HAS_FD_MEMBER is 0, ensure readdir.c gets compiled. * modules/readdir (configure.ac): Consider REPLACE_READDIR. -- * lib/rewinddir.c (rewinddir): On mingw, redirect to the original rewinddir function. Prefer testing HAVE_DIRENT_H, for consistency with dirent.h. * m4/rewinddir.m4 (gl_FUNC_REWINDDIR): If DIR_HAS_FD_MEMBER is 0, ensure rewinddir.c gets compiled. * modules/rewinddir (configure.ac): Consider REPLACE_REWINDDIR. -- * lib/fchdir.c (dir_info_t): Remove a FIXME.
* select, pselect: Fix test failure on native Windows.Bruno Haible2023-04-242-2/+11
| | | | | * lib/select.c (rpl_select): Fail if nfds is out-of-range. * lib/pselect.c (pselect): Likewise.
* system-quote: Fix memory overrun bug on native Windows.Bruno Haible2023-04-241-1/+1
| | | | | * lib/system-quote.c (system_quote): Allocate enough space for the result.
* libunistring: Fix build on Windows, when a libunistring is installed.Bruno Haible2023-04-233-137/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* getumask: Make it work on native Windows.Bruno Haible2023-04-201-0/+10
| | | | | | * 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.
* assert-h, verify: Fix compilation error in C++ mode with MSVC 14.30.Bruno Haible2023-04-201-5/+11
| | | | | | * 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.
* ctime: Fix compilation errors in C++ mode on mingw 10.Bruno Haible2023-04-202-0/+8
| | | | | | * 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-201-0/+4
| | | | | * lib/stdlib.in.h (random, srandom): Disable _GL_CXXALIASWARN invocation on non-glibc systems.
* wcsncmp: Work around two ISO C compliance bugs on several platforms.Bruno Haible2023-04-192-4/+17
| | | | | | | | | | | | | * 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: Work around two ISO C compliance bugs on several platforms.Bruno Haible2023-04-192-4/+15
| | | | | | | | | | | | | * 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: Work around ISO C compliance bug on several platforms.Bruno Haible2023-04-192-4/+17
| | | | | | | | | | | | * 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.
* isnan: Fix compilation error in C++ mode on FreeBSD 13.2.Bruno Haible2023-04-151-0/+5
| | | | | * lib/math.in.h (isnan): On FreeBSD 13.2 or newer, don't declare isnan through _GL_MATH_CXX_REAL_FLOATING_DECL_2.
* filemode: Fix double-inclusion guard.Bruno Haible2023-04-141-0/+1
| | | | * lib/filemode.h: Make the double-inclusion guard actually work.
* year2038: Add reminder to include <config.h> before time_t gets defined.Bruno Haible2023-04-147-0/+49
| | | | | | | | | | | | * lib/sched.in.h: Check that config.h was already included before the * lib/sys_select.in.h: Likewise. * lib/sys_stat.in.h: Likewise. * lib/sys_time.in.h: Likewise. * lib/sys_types.in.h: Likewise. * lib/time.in.h: Likewise. * lib/utime.in.h: Likewise. * modules/year2038 (Depends-on): Add sched, sys_msg, sys_select, sys_sem, sys_shm, sys_stat, sys_time, sys_types, time-h, utime-h.
* sys_shm: New module.Bruno Haible2023-04-141-0/+30
| | | | | | | * lib/sys_shm.in.h: New file. * m4/sys_shm_h.m4: New file. * modules/sys_shm: New file. * doc/posix-headers/sys_shm.texi: Mention the new module.
* sys_sem: New module.Bruno Haible2023-04-141-0/+30
| | | | | | | * lib/sys_sem.in.h: New file. * m4/sys_sem_h.m4: New file. * modules/sys_sem: New file. * doc/posix-headers/sys_sem.texi: Mention the new module.
* sys_msg: New module.Bruno Haible2023-04-141-0/+30
| | | | | | | * lib/sys_msg.in.h: New file. * m4/sys_msg_h.m4: New file. * modules/sys_msg: New file. * doc/posix-headers/sys_msg.texi: Mention the new module.
* Add more reminders to include <config.h>.Bruno Haible2023-04-1329-0/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/aligned-malloc.h: Check that config.h was already included. * lib/careadlinkat.h: Likewise. * lib/filemode.h: Likewise. * lib/freadptr.h: Likewise. * lib/fseterr.h: Likewise. * lib/glthread/lock.h: Likewise. * lib/glthread/tls.h: Likewise. * lib/immutable.h: Likewise. * lib/isapipe.h: Likewise. * lib/isnand-nolibm.h: Likewise. * lib/isnanf-nolibm.h: Likewise. * lib/isnanl-nolibm.h: Likewise. * lib/mbswidth.h: Likewise. * lib/md5.h: Likewise. * lib/minmax.h: Likewise. * lib/msvc-inval.h: Likewise. * lib/msvc-nothrow.h: Likewise. * lib/pathmax.h: Likewise. * lib/sha1.h: Likewise. * lib/sha256.h: Likewise. * lib/sha512.h: Likewise. * lib/size_max.h: Likewise. * lib/sm3.h: Likewise. * lib/stat-size.h: Likewise. * lib/termcap.h: Likewise. * lib/terminfo.h: Likewise. * lib/thread-optim.h: Likewise. * lib/unlocked-io.h: Likewise. * lib/vma-iter.h: Likewise.
* Adjust comments in <config.h> reminders.Bruno Haible2023-04-1325-25/+30
| | | | * lib/*.h: In the comments, mention also HAVE_*.
* Adjust comments in <config.h> reminders.Bruno Haible2023-04-1345-45/+50
| | | | | * lib/*.in.h: In the comments, mention also HAVE_RAW_DECL_*. * Makefile (sc_check_config_h_reminder): Search also for HAVE_RAW_DECL_.
* utmp: Avoid using HAVE_* macros in *.in.h files.Bruno Haible2023-04-131-3/+3
| | | | | | | | | | | | | * m4/pty_h.m4 (gl_PTY_CHECK_UTIL_H): New macro, extracted from gl_PTY_H. (gl_PTY_H): Invoke it. * m4/utmp_h.m4 (gl_UTMP_H): Invoke gl_PTY_CHECK_UTIL_H and set HAVE_TERMIOS_H. (gl_UTMP_H_DEFAULTS): Require gl_PTY_H_DEFAULTS, gl_TERMIOS_H_DEFAULTS. * modules/utmp (Files): Add m4/pty_h.m4, m4/termios_h.m4. (Makefile.am): Substitute also HAVE_UTIL_H, HAVE_LIBUTIL_H, HAVE_TERMIOS_H. * lib/utmp.in.h: Test HAVE_UTIL_H, HAVE_LIBUTIL_H, HAVE_TERMIOS_H as Autoconf variables.
* getprogname: Avoid using HAVE_* macros in *.in.h files.Bruno Haible2023-04-131-2/+2
| | | | | | | | | | | * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize HAVE_DECL_PROGRAM_INVOCATION_NAME. * m4/getprogname.m4 (gl_FUNC_GETPROGNAME): Require gl_STDLIB_H_DEFAULTS and gl_USE_SYSTEM_EXTENSIONS. Set HAVE_DECL_PROGRAM_INVOCATION_NAME. * modules/stdlib (Makefile.am): Substitute HAVE_DECL_PROGRAM_INVOCATION_NAME. * lib/stdlib.in.h (getprogname): Test HAVE_DECL_PROGRAM_INVOCATION_NAME as an Autoconf variable.