summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* careadlinkat: pacify -Wreturn-local-addrPaul Eggert2020-05-091-10/+19
| | | | | | * lib/careadlinkat.c (careadlinkat) [GCC_LINT]: Pacify gcc 10’s -Wreturn-local-addr option. Simplify some of the later code.
* attribute: remove ATTRIBUTE_DEPRECATEDPaul Eggert2020-05-091-96/+65
| | | | | | | | * lib/attribute.h: Improve recently-added comments, mostly by shortening them (use active voice, etc.). (ATTRIBUTE_DEPRECATED): Remove, as it duplicates DEPRECATED. Problem reported by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2020-05/msg00089.html
* attribute: Add comments.Bruno Haible2020-05-091-0/+154
| | | | * lib/attribute.h: Document each macro.
* bitset: use the attribute moduleAkim Demaille2020-05-097-16/+15
| | | | | | | | * modules/bitset: Depend on 'attribute'. * lib/bitset/base.h (ATTRIBUTE_UNUSED): Remove. * lib/bitset.c, lib/bitset/array.c, lib/bitset/list.c, * lib/bitset/stats.c, lib/bitset/table.c, lib/bitset/vector.c: Use MAYBE_UNUSED instead of ATTRIBUTE_UNUSED.
* c-stack: Fix warning when DEBUG is enabled.Bruno Haible2020-05-091-0/+4
| | | | | | | Patch suggested by Marc Nieper-Wißkirchen <marc.nieper+gnu@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00081.html>. * lib/c-stack.c: Include <stdio.h>.
* Remove redundant definitions of _GL_ATTRIBUTE_FORMAT.Bruno Haible2020-05-0912-144/+0
| | | | | | | | | | | | | | | * lib/argp.h (_GL_ATTRIBUTE_FORMAT): Remove macro. * lib/argp-fmtstream.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/c-snprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/c-vasnprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/c-vasprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/c-vsnprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/c-xvasprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/error.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/parse-datetime.y (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/vasnprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/xprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/xvasprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise.
* Remove redundant definitions of _GL_ATTRIBUTE_ALLOC_SIZE.Bruno Haible2020-05-093-21/+0
| | | | | | | | | Reported by Akim Demaille in <https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00077.html>. * lib/eealloc.h (_GL_ATTRIBUTE_ALLOC_SIZE): Remove macro. * lib/pagealign_alloc.h (_GL_ATTRIBUTE_ALLOC_SIZE): Likewise. * lib/xalloc.h (_GL_ATTRIBUTE_ALLOC_SIZE): Likewise.
* stdio, monetary: Don't redefine _GL_ATTRIBUTE_FORMAT.Bruno Haible2020-05-092-8/+12
| | | | | | * lib/stdio.in.h (_GL_ATTRIBUTE_FORMAT): Don't override the definition that usually comes from m4/gnulib-common.m4. * lib/monetary.in.h (_GL_ATTRIBUTE_FORMAT): Likewise.
* dirent, stdlib, wchar, string: Don't redefine _GL_ATTRIBUTE_PURE.Bruno Haible2020-05-094-16/+24
| | | | | | | | * lib/dirent.in.h (_GL_ATTRIBUTE_PURE): Don't override the definition that usually comes from m4/gnulib-common.m4. * lib/stdlib.in.h (_GL_ATTRIBUTE_PURE): Likewise. * lib/string.in.h (_GL_ATTRIBUTE_PURE): Likewise. * lib/wchar.in.h (_GL_ATTRIBUTE_PURE): Likewise.
* uchar: Work around incorrect char16_t, char32_t types on Haiku 2020.Bruno Haible2020-05-091-0/+14
| | | | | | | | | | | | | | * lib/uchar.in.h (char16_t): Define as macro if GNULIB_OVERRIDES_CHAR16_T. (char32_t): Define as macro if GNULIB_OVERRIDES_CHAR32_T. * m4/uchar.m4 (gl_TYPE_CHAR16_T, gl_TYPE_CHAR32_T): New macros. (gl_UCHAR_H): Invoke them. (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_OVERRIDES_CHAR16_T, GNULIB_OVERRIDES_CHAR32_T. * m4/mbrtoc32.m4 (gl_FUNC_MBRTOC32, gl_MBRTOC32_SANITYCHECK): Require gl_TYPE_CHAR32_T and test GNULIB_OVERRIDES_CHAR32_T. * modules/uchar (Makefile.am): Substitute GNULIB_OVERRIDES_CHAR16_T, GNULIB_OVERRIDES_CHAR32_T.
* limits-h: Define LONG_BIT correctly on Haiku/x86_64.Bruno Haible2020-05-091-3/+20
| | | | * lib/limits.in.h: Define and test _GL_ALREADY_INCLUDING_LIMITS_H.
* uniname/uniname: Use module 'attribute'.Bruno Haible2020-05-083-16/+6
| | | | | | | * lib/uniname/gen-uninames.lisp: Emit a reference to ATTRIBUTE_PACKED. * lib/uniname/uninames.h: Regenerated. * lib/uniname/uniname.c: Include attribute.h. * modules/uniname/uniname (Depends-on): Add attribute.
* c32rtomb: Use module 'attribute'.Bruno Haible2020-05-081-8/+1
| | | | | | * lib/c32rtomb.c: Include attribute.h. (FALLTHROUGH): Remove macro. * modules/c32rtomb (Depends-on): Add attribute.
* xsize: Use module 'attribute'.Bruno Haible2020-05-081-16/+7
| | | | | * lib/xsize.h: Include attribute.h. Use ATTRIBUTE_PURE. * modules/xsize (Depends-on): Add attribute.
* * lib/attribute.h: Minor style fixes.Paul Eggert2020-05-061-6/+6
|
* Fix version-etc glitch on OpenIndianaPaul Eggert2020-05-061-10/+1
| | | | | | | Problem reported by Mats Erik Andersson in: https://lists.gnu.org/r/bug-gnulib/2020-05/msg00067.html * lib/version-etc.h (_GL_ATTRIBUTE_SENTINEL): Remove defn that now clashes with gnulib-common.h. All uses changed.
* attribute: add _GL_ATTRIBUTE_RETURNS_NONNULLPaul Eggert2020-05-031-0/+1
|
* attribute: minor fixupsPaul Eggert2020-05-033-4/+5
| | | | | Suggested by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2020-05/msg00049.html
* attribute: new modulePaul Eggert2020-05-0329-328/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies use of GCC and C2X attributes like ‘deprecated’. * MODULES.html.sh: Add attribute. * doc/attribute.texi, lib/attribute.h, modules/attribute: New files. * doc/gnulib.texi (Particular Modules): Add Attributes. * lib/backupfile.c, lib/fnmatch.c, lib/freopen-safer.c: * lib/mbrtoc32.c, lib/mbrtowc.c, lib/nstrftime.c, lib/quotearg.c: * lib/savewd.c, lib/unistr/u8-uctomb-aux.c, lib/unistr/u8-uctomb.c: * lib/vasnprintf.c: Include attribute.h, and let it define FALLTHROUGH. * lib/bitset/base.h, lib/c-stack.c (__attribute__): Remove macro. * lib/bitset/base.h (ATTRIBUTE_UNUSED): Define in terms of _GL_ATTRIBUTE_MAYBE_UNUSED, for forwards compatibility to C2X. * lib/dfa.c (FALLTHROUGH): Define consistently with gl_COMMON_BODY. This is a copy since Gawk doesn’t use Gnulib. * lib/di-set.h (_GL_ATTRIBUTE_NONNULL): Remove definition that is incompatible with gl_COMMON_BODY’s. All uses changed. * lib/fts.c: Include attribte.h, for FALLTHROUGH. Keep the existing FALLTHROUGH definition since Glibc might use it, and it does no harm to Gnulib’s FALLTHROUGH. * lib/fts_.h, lib/inttostr.h: (__GNUC_PREREQ): Remove; no longer needed. (__attribute_warn_unused_result__): Remove. All uses replaced by _GL_ATTRIBUTE_NODISCARD. * lib/gl_list.h, lib/gl_map.h, lib/gl_omap.h, lib/gl_oset.h: * lib/gl_set.h: Prefer _GL_ATTRIBUTE_NODISCARD to an ifdeffed __attribute__ ((__warn_unused_result__)), for forward compatibility to C2X. * lib/hash.h (_GL_ATTRIBUTE_WUR): Remove. All uses replaced by _GL_ATTRIBUTE_NODISCARD. (_GL_ATTRIBUTE_DEPRECATED): Remove, since gl_COMMON_BODY defines it. * lib/ino-map.h (_GL_ATTRIBUTE_NONNULL): Remove. All uses replaced by gl_COMMON_BODY’s implementation, which has a slightly different signature. * lib/safe-alloc.h (_GL_ATTRIBUTE_RETURN_CHECK): Remove. All uses replaced by _GL_ATTRIBUTE_NODISCARD. * lib/unused-parameter.h (_GL_UNUSED_PARAMETER): Define in terms of _GL_ATTRIBUTE_MAYBE_UNUSED. No doubt all uses should be replaced, at some point. * m4/gnulib-common.m4 (_GL_GNUC_PREREQ): New macro. (_Noreturn): Use it. (_GL_HAS_ATTRIBUTE, _GL_ATTRIBUTE_ALLOC_SIZE) (_GL_ATTRIBUTE_ALWAYS_INLINE, _GL_ATTRIBUTE_ARTIFICIAL) (_GL_ATTRIBUTE_COLD) (_GL_ATTRIBUTE_DEPRECATED, _GL_ATTRIBUTE_ERROR) (_GL_ATTRIBUTE_WARNING, _GL_ATTRIBUTE_EXTERNALLY_VISIBLE) (_GL_ATTRIBUTE_FALLTHROUGH, _GL_ATTRIBUTE_FORMAT) (_GL_ATTRIBUTE_LEAF, _GL_ATTRIBUTE_MAY_ALIAS) (_GL_ATTRIBUTE_MAYBE_UNUSED) (_GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOINLINE) (_GL_ATTRIBUTE_NONNULL, _GL_ATTRIBUTE_NONSTRING) (_GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED, _GL_ATTRIBUTE_PURE) (_GL_ATTRIBUTE_SENTINEL): New macros. * modules/backup-rename, modules/backupfile, modules/c-vasnprintf: * modules/fnmatch, modules/freopen-safer, modules/fts: * modules/mbrtoc32, modules/mbrtowc, modules/nstrftime: * modules/quotearg, modules/savewd: * modules/unistdio/u16-u16-vasnprintf: * modules/unistdio/u16-vasnprintf: * modules/unistdio/u32-u32-vasnprintf: * modules/unistdio/u32-vasnprintf: * modules/unistdio/u8-u8-vasnprintf: * modules/unistdio/u8-vasnprintf: * modules/unistdio/ulc-vasnprintf: * modules/unistr/u8-uctomb, modules/vasnprintf: (Depends-on:): Add attribute module.
* list-c++: Add get_first, get_last, set_first, set_last operations.Bruno Haible2020-05-032-6/+28
| | | | | | * lib/gl_list.hh (class gl_List): Add methods get_first, get_last, set_first, set_last. * lib/gl_list.h: Tweak comments.
* list: Add get_first, get_last, set_first, set_last operations.Bruno Haible2020-05-022-0/+86
| | | | | | * lib/gl_list.h (gl_list_get_first, gl_list_get_last, gl_list_nx_set_first, gl_list_nx_set_last): New functions. * lib/gl_xlist.h (gl_list_set_first, gl_list_set_last): New functions.
* list: Remove redundant code for remove_first and remove_last operations.Bruno Haible2020-05-0212-203/+10
| | | | | | | | | | | | | | | | | * lib/gl_list.h (struct gl_list_implementation): Remove fields remove_first, remove_last. (gl_list_remove_first, gl_list_remove_last): Implement in a generic way. * lib/gl_array_list.c: Revert last change. * lib/gl_carray_list.c: Likewise. * lib/gl_anylinked_list2.h: Likewise. * lib/gl_linked_list.c: Likewise. * lib/gl_linkedhash_list.c: Likewise. * lib/gl_anytree_list2.h: Likewise. * lib/gl_avltree_list.c: Likewise. * lib/gl_avltreehash_list.c: Likewise. * lib/gl_rbtree_list.c: Likewise. * lib/gl_rbtreehash_list.c: Likewise. * lib/gl_sublist.c: Likewise.
* list: Add remove_first and remove_last operations.Bruno Haible2020-05-0213-0/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suggested by Marc Nieper-Wißkirchen <marc.nieper+gnu@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-04/msg00092.html>. * lib/gl_list.h (struct gl_list_implementation): Add fields remove_first, remove_last. (gl_list_remove_first, gl_list_remove_last): New functions. * lib/gl_array_list.c (gl_array_remove_first, gl_array_remove_last): New functions, based on gl_array_remove_at. (gl_array_list_implementation): Implement the new operations. * lib/gl_carray_list.c (gl_carray_remove_first, gl_carray_remove_last): New functions, based on gl_carray_remove_at. (gl_carray_list_implementation): Implement the new operations. * lib/gl_anylinked_list2.h (gl_linked_remove_first, gl_linked_remove_last): New functions, based on gl_linked_remove_at. * lib/gl_linked_list.c (gl_linked_list_implementation): Implement the new operations. * lib/gl_linkedhash_list.c (gl_linkedhash_list_implementation): Likewise. * lib/gl_anytree_list2.h (gl_tree_remove_first, gl_tree_remove_last): New functions, based on gl_tree_remove_at. * lib/gl_avltree_list.c (gl_avltree_list_implementation): Implement the new operations. * lib/gl_avltreehash_list.c (gl_avltreehash_list_implementation): Likewise. * lib/gl_rbtree_list.c (gl_rbtree_list_implementation): Likewise. * lib/gl_rbtreehash_list.c (gl_rbtreehash_list_implementation): Likewise. * lib/gl_sublist.c (gl_sublist_remove_first, gl_sublist_remove_last): New functions, based on gl_sublist_remove_at. (gl_sublist_list_implementation): Implement the new operations. * lib/gl_list.hh (class gl_List): Add methods remove_first, remove_last. * tests/test-array_list.c (main): Test also gl_list_remove_first and gl_list_remove_last. * tests/test-avltree_list.c (main): Likewise. * tests/test-avltreehash_list.c (main): Likewise. * tests/test-carray_list.c (main): Likewise. * tests/test-linked_list.c (main): Likewise. * tests/test-linkedhash_list.c (main): Likewise. * tests/test-rbtree_list.c (main): Likewise. * tests/test-rbtreehash_list.c (main): Likewise.
* posix_spawn_file_actions_destroy: Fix a crash (bug from 2019-06-10).Bruno Haible2020-04-281-1/+3
| | | | | * lib/spawn_faction_destroy.c (posix_spawn_file_actions_destroy): Don't access elements of the wrong union member.
* getdate: Remove deprecated module.Bruno Haible2020-04-281-3/+0
| | | | | | | * modules/getdate: Remove file. * doc/getdate.texi: Remove file. * lib/getdate.h: Remove file. * NEWS: Mention the removal.
* pipe: Remove deprecated module.Bruno Haible2020-04-281-2/+0
| | | | | | * modules/pipe: Remove file. * lib/pipe.h: Remove file. * NEWS: Mention the removal.
* Tune fts for FTS_LOGICAL+FTS_NOSTATPaul Eggert2020-04-251-3/+4
| | | | | | | | | From a suggestion by Askar Safin in: https://lists.gnu.org/r/bug-gnulib/2020-04/msg00074.html * lib/fts.c (fts_build): If file types are known, optimize FTS_LOGICAL+FTS_NOSTAT for non-symlinks and non-directories the same way that we already optimize FTS_PHYSICAL+FTS_NOSTAT for non-directories.
* vasnprintf: Add support for printing wide characters using escapes.Bruno Haible2020-04-191-28/+293
| | | | | | | | | | * lib/vasnprintf.c (ENABLE_WCHAR_FALLBACK): Document optional macro. (wctomb_fallback): New function. (local_wctomb): New function. (local_wcrtomb): New function or macro. (MAX_ROOM_NEEDED): Adjust estimate for %lc. (VASNPRINTF): Simplify %ls code by use of local_wcrtomb. Add code for %lc.
* fts: remove NOSTAT_LEAF_OPTIMIZATIONPaul Eggert2020-04-152-53/+8
| | | | | | | | | | | | | | | | It caused ‘find’ and ‘du’ to dump core, and it was useful only for obsolescent Linux filesystems anyway. Problem reported in: https://lists.gnu.org/r/bug-gnulib/2020-04/msg00068.html Quite possibly there is still a serious underlying fts bug with tight-loop-check and mutating file systems, but if so this patch should cause the bug to be triggered less often. * lib/fts.c (enum leaf_optimization): Remove NOSTAT_LEAF_OPTIMIZATION, as it’s problematic. (S_MAGIC_REISERFS, S_MAGIC_XFS): Remove; no longer needed. (leaf_optimization): Remove special cases for ReiserFS and XFS. (fts_read): Remove NOSTAT_LEAF_OPTIMIZATION code. * lib/fts_.h (struct _ftsent.fts_n_dirs_remaining): Remove. All uses removed.
* explicit_bzero: Improve code style.Bastien Roucariès2020-04-141-1/+1
| | | | * lib/explicit_bzero.c (explicit_bzero): Use '\0' instead of 0.
* explicit_bzero: On native Windows, use SecureZeroMemory().Bastien Roucariès2020-04-141-1/+8
| | | | | | | * lib/explicit_bzero.c: Include <windows.h>. (explicit_bzero): On native Windows, use SecureZeroMemory. Signed-off-by: Bastien Roucariès <rouca@debian.org>
* explicit_bzero: Use memset_s() when available.Bastien Roucariès2020-04-141-0/+7
| | | | | | | | | | Some OS define memset_s instead of explicit_bzero. Use it. * lib/explicit_bzero.c (__STDC_WANT_LIB_EXT1__): Define. (explicit_bzero): Use memset_s when available. * m4/explicit_bzero.m4 (gl_PREREQ_EXPLICIT_BZERO): Test for memset_s. Signed-off-by: Bastien Roucariès <rouca@debian.org>
* findprog, relocatable-prog: Ignore directories during PATH search.Bruno Haible2020-04-103-26/+39
| | | | | | | | | | | | | | | | Reported by Frederick Eaton via Dmitry Goncharov in <https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00003.html>. * lib/findprog.c (find_in_path): When the file found in a PATH element is a directory, continue searching. * modules/findprog (Depends-on): Add sys_stat, stat. * modules/findprog-lgpl (Depends-on): Likewise. * lib/progreloc.c (maybe_executable): When the file found in a PATH element is a directory, continue searching. * lib/relocwrapper.c: Update comments. * modules/relocatable-prog-wrapper (Files): Add m4/largefile.m4. (configure.ac-early): New section.
* Use module 'filename' instead of module 'dosname'.Bruno Haible2020-03-2812-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/at-func.c: Include filename.h instead of dosname.h. * lib/unlinkat.c: Likewise. * modules/areadlinkat (Depends-on): Add filename. Remove dosname. * modules/areadlinkat-with-size (Depends-on): Likewise. * modules/faccessat (Depends-on): Likewise. * modules/fchmodat (Depends-on): Likewise. * modules/fchownat (Depends-on): Likewise. * modules/fstatat (Depends-on): Likewise. * modules/mkdirat (Depends-on): Likewise. * modules/mkfifoat (Depends-on): Likewise. * modules/readlinkat (Depends-on): Likewise. * modules/selinux-at (Depends-on): Likewise. * modules/symlinkat (Depends-on): Likewise. * modules/unlinkat (Depends-on): Likewise. * modules/utimensat (Depends-on): Likewise. * lib/at-func2.c: Include filename.h instead of dosname.h. * modules/linkat (Depends-on): Add filename. Remove dosname. * modules/renameatu (Depends-on): Likewise. * lib/canonicalize.c: Include filename.h instead of dosname.h. * lib/canonicalize-lgpl.c: Likewise. * modules/canonicalize (Depends-on): Add filename. * modules/canonicalize-lgpl (Depends-on): Likewise. * lib/dirname.h: Include filename.h instead of dosname.h. * modules/dirname-lgpl (Depends-on): Add filename. Remove dosname. * lib/fchdir.c: Include filename.h instead of dosname.h. * modules/fchdir (Depends-on): Add filename. Remove dosname. * lib/openat.c: Include filename.h instead of dosname.h. * modules/openat (Depends-on): Add filename. Remove dosname. * lib/rmdir.c: Include filename.h instead of dosname.h. * modules/rmdir (Depends-on): Add filename. Remove dosname. * lib/savewd.c: Include filename.h instead of dosname.h. * modules/savewd (Depends-on): Add filename. Remove dosname. * lib/unlink.c: Include filename.h instead of dosname.h. * modules/unlink (Depends-on): Add filename. Remove dosname. * modules/relocatable-prog-wrapper (Depends-on): Add filename. * lib/relocwrapper.c: Update comments. * modules/lstat (Depends-on): Remove dosname.
* dosname: Redirect to 'filename'.Bruno Haible2020-03-281-37/+2
| | | | | | | | | Reported by Tim Rühsen <tim.ruehsen@gmx.de> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00042.html>. * lib/dosname.h: Remove all definitions. Just include filename.h. * modules/dosname (Status, Notice): Mark as deprecated. (Depends-on): Add 'filename'.
* dosname: Change IS_RELATIVE_FILE_NAME.Bruno Haible2020-03-281-1/+2
| | | | | | * lib/dosname.h (IS_RELATIVE_FILE_NAME): On native Windows, OS/2, DOS, change the definition so that IS_RELATIVE_FILE_NAME("c:") is false. * NEWS: Mention the change.
* filename: Copy some definitions from module 'dosname'.Bruno Haible2020-03-283-26/+82
| | | | | | | | | | | | | | | | | * lib/filename.h: Include <string.h>, for IS_FILE_NAME_WITH_DIR. (HAS_DEVICE): Document macro. (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE): New macro. (IS_ABSOLUTE_FILE_NAME): Consider FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE. (IS_RELATIVE_FILE_NAME, IS_FILE_NAME_WITH_DIR): New macros. (IS_ABSOLUTE_PATH, IS_PATH_WITH_DIR): Define as deprecated aliases. * lib/relocatable.c (IS_FILE_NAME_WITH_DIR): Renamed from IS_PATH_WITH_DIR. (DllMain): Update. * lib/progreloc.c (IS_FILE_NAME_WITH_DIR): Renamed from IS_PATH_WITH_DIR. (find_executable): Update. * NEWS: Document the deprecations.
* getopt-posix: port __GETOPT_PREFIX to macOSPaul Eggert2020-03-251-0/+8
| | | | | * lib/getopt-pfx-core.h (_GETOPT) [__APPLE__ && __GETOPT_PREFIX]: Define to work around a problem with asm on macOS (Bug#40205).
* unlink: fix malloc errno typoPaul Eggert2020-03-211-4/+1
| | | | | | Problem reported by Tim Rühsen in: https://lists.gnu.org/r/bug-gnulib/2020-03/msg00044.html * lib/unlink.c (rpl_unlink): Don’t mask malloc errno.
* Revert my last commit, due to compilation errors.Bruno Haible2020-03-072-32/+23
|
* open, openat: port to (O_RDWR | O_RDONLY) != 0Paul Eggert2020-03-072-2/+6
| | | | | | | | Potential portability problem reported by Dan Gohman in: https://lists.gnu.org/r/bug-gnulib/2020-03/msg00000.html * lib/open.c (open): * lib/openat.c (rpl_openat): Don’t assume O_RDONLY is disjoint from O_RDWR.
* findprog, relocatable-prog: Ignore directories during PATH search.Bruno Haible2020-03-072-23/+32
| | | | | | | | | Reported by Frederick Eaton via Dmitry Goncharov in <https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00003.html>. * lib/findprog.c (find_in_path): When the file found in a PATH element is a directory, continue searching. * lib/progreloc.c (maybe_executable): Likewise.
* openat: Fix theoretically possible issue on GNU/Hurd.Bruno Haible2020-03-071-1/+1
| | | | | | | | Reported by Dan Gohman <sunfish@mozilla.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00000.html>. * lib/openat.c (rpl_openat): When testing whether flags contains O_RDWR, ignore the bits that are also set in O_RDONLY.
* fcntl: Add witness of gnulib override.Bruno Haible2020-02-241-0/+6
| | | | | | | | Reported by Jens Rehsack <sno@netbsd.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-02/msg00137.html>. * lib/fcntl.in.h (GNULIB_defined_rpl_fcntl, GNULIB_defined_fcntl): New macros.
* uni*/base: Use 'restrict'.Bruno Haible2020-02-238-91/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/unitypes.in.h (_UC_RESTRICT): New macro, based on '_Restrict_' from lib/regex.h. * lib/unistr.in.h (u8_cpy, u16_cpy, u32_cpy, u8_strcpy, u16_strcpy, u32_strcpy, u8_stpcpy, u16_stpcpy, u32_stpcpy, u8_strncpy, u16_strncpy, u32_strncpy, u8_stpncpy, u16_stpncpy, u32_stpncpy, u8_strcat, u16_strcat, u32_strcat, u8_strncat, u16_strncat, u32_strncat, u8_strtok, u16_strtok, u32_strtok): Use '_UC_RESTRICT'. * lib/uninorm.in.h (u8_normalize, u16_normalize, u32_normalize): Use '_UC_RESTRICT'. * lib/uniconv.in.h (u8_conv_to_encoding, u16_conv_to_encoding, u32_conv_to_encoding): Use '_UC_RESTRICT'. * lib/unicase.in.h (u8_toupper, u16_toupper, u32_toupper, u8_tolower, u16_tolower, u32_tolower, u8_totitle, u16_totitle, u32_totitle, u8_ct_toupper, u16_ct_toupper, u32_ct_toupper, u8_ct_tolower, u16_ct_tolower, u32_ct_tolower, u8_ct_totitle, u16_ct_totitle, u32_ct_totitle, u8_casefold, u16_casefold, u32_casefold, u8_ct_casefold, u16_ct_casefold, u32_ct_casefold, u8_casexfrm, u16_casexfrm, u32_casexfrm, ulc_casexfrm): Use '_UC_RESTRICT'. * lib/unilbrk.in.h (u8_possible_linebreaks, u16_possible_linebreaks, u32_possible_linebreaks, ulc_possible_linebreaks, u8_width_linebreaks, u16_width_linebreaks, u32_width_linebreaks, ulc_width_linebreaks): Use '_UC_RESTRICT'. * lib/uniwbrk.in.h (ulc_wordbreaks): Use '_UC_RESTRICT'. * lib/unistdio.in.h (ulc_sprintf, ulc_snprintf, ulc_asnprintf, ulc_vsprintf, ulc_vsnprintf, ulc_vasnprintf, u8_u8_sprintf, u8_u8_snprintf, u8_u8_asnprintf, u8_u8_vsprintf, u8_u8_vsnprintf, u8_u8_vasnprintf, u16_u16_sprintf, u16_u16_snprintf, u16_u16_asnprintf, u16_u16_vsprintf, u16_u16_vsnprintf, u16_u16_vasnprintf, u32_u32_sprintf, u32_u32_snprintf, u32_u32_asnprintf, u32_u32_vsprintf, u32_u32_vsnprintf, u32_u32_vasnprintf): Use '_UC_RESTRICT'.
* glob, spawn: Use improved '_Restrict_' definition.Bruno Haible2020-02-232-15/+16
| | | | | * lib/glob.in.h (_Restrict_): Use same definition as in lib/regex.h. * lib/spawn.in.h (_Restrict_, _Restrict_arr_): Likewise.
* crypto/gc: Use 'restrict'.Bruno Haible2020-02-231-2/+2
| | | | | * lib/gc.h (gc_pbkdf2_hmac, gc_pbkdf2_sha1): Use 'restrict'. * m4/gc.m4 (gl_GC): Require AC_C_RESTRICT.
* crypto/hmac-*: Use 'restrict'.Bruno Haible2020-02-231-4/+4
| | | | | | | | | * lib/hmac.h (hmac_md5, hmac_sha1, hmac_sha256, hmac_sha512): Use 'restrict'. * modules/crypto/hmac-md5 (configure.ac): Require AC_C_RESTRICT. * modules/crypto/hmac-sha1 (configure.ac): Likewise. * modules/crypto/hmac-sha256 (configure.ac): Likewise. * modules/crypto/hmac-sha512 (configure.ac): Likewise.
* crypto/sm3: Use 'restrict'.Bruno Haible2020-02-231-3/+4
| | | | | * lib/sm3.h (sm3_finish_ctx, sm3_read_ctx, sm3_buffer): Use 'restrict'. * m4/sm3.m4 (gl_SM3): Require AC_C_RESTRICT.
* crypto/*-buffer: Use 'restrict'.Bruno Haible2020-02-231-3/+3
| | | | | * lib/gl_openssl.h (GL_CRYPTO_FN (_finish_ctx), GL_CRYPTO_FN (_buffer), GL_CRYPTO_FN (_read_ctx)): Use 'restrict'.