lib


Log

Author Commit Date CI Message
Akim Demaille 5ac17e36 2018-10-11T22:15:36 timevar: improve the output format From: Execution times (seconds) reader : 0,01 ( 3%) usr 0,00 (16%) sys 0,00 ( 0%) wall outputting report : 0,03 ( 6%) usr 0,00 (15%) sys 0,00 ( 0%) wall parser action tables : 0,02 ( 4%) usr 0,00 ( 2%) sys 0,00 ( 0%) wall outputting parser : 0,01 ( 2%) usr 0,00 (13%) sys 0,00 ( 0%) wall running m4 : 0,37 (84%) usr 0,00 (50%) sys 0,00 ( 0%) wall total time : 0,44 0,01 0,00 To: Execution times (seconds) CPU user CPU system wall clock reader 0,020 ( 4%) 0,002 ( 9%) 0,000000 ( 0%) outputting report 0,029 ( 6%) 0,002 (11%) 0,000000 ( 0%) parser action tables 0,020 ( 4%) 0,001 ( 6%) 0,000000 ( 0%) outputting parser 0,014 ( 3%) 0,002 (10%) 0,000000 ( 0%) running m4 0,431 (83%) 0,012 (59%) 0,000000 ( 0%) total time 0,522 0,020 0,000000 Suggested by Bruno Haible. See https://lists.gnu.org/archive/html/bug-gnulib/2018-10/msg00040.html. * lib/timevar.c (timevar_print): Use %7.3f for usr/sys and %11.6f for wall, since its resolution is much higher.
Akim Demaille da905bea 2018-10-11T17:54:35 timevar: expect that getrusage is available Don't keep both times and getrusage as backend: both are guaranteed by gnulib, a single one suffices. Using getrusage is open to possibly tracking other types of resources in the future. * modules/timevar (Depends-on): Add getrusage. (configure.ac): Remove gl_TIMEVAR. (Files): Remove m4/timevar.m4. * m4/timevar.m4: Remove, rely on gnulib for getrusage. * lib/timevar.h (timevar_enabled): Clarify documentation. * lib/timevar.c: Remove all the code about times. Remove all the CPP guards about getrusage: expect it to be present (courtesy of gnulib).
Bruno Haible f7a6286e 2018-10-12T11:12:53 mountlist: Improve support for Solaris in 64-bit mode. Reported by David Wood <David.Wood@deshaw.com> in <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=6816>. * m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): On Solaris 8 or newer, define MOUNTED_GETEXTMNTENT instead of MOUNTED_GETMNTENT2. * lib/mountlist.c: Add code for MOUNTED_GETEXTMNTENT case.
Bruno Haible d1327df1 2018-10-12T11:06:33 mountlist: Add support for Minix. Reported by Assaf Gordon in <https://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00074.html>. * m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Don't use AC_CHECK_FUNCS to check for 'getmntinfo'. * lib/mountlist.c: Update comments.
Bruno Haible 74c29c68 2018-10-11T23:29:28 mountlist: Modernize platform lists. * m4/ls-mntd-fs.m4: Clarify which MOUNTED_* symbol applies to which platforms, deemphasizing the obsolete ones. * lib/mountlist.c: Likewise.
Bruno Haible 32e75188 2018-10-11T20:07:00 getprogname: Add support for 32-bit programs on HP-UX. * lib/getprogname.c (getprogname) [HP-UX]: If pstat_getproc fails, try the similar functions 32-bit programs on 64-bit HP-UX.
Bruno Haible 07b97b05 2018-10-11T18:24:51 getprogname: Work around program name truncation when possible. * lib/getprogname.c (getprogname) [HP-UX]: When pst_ucomm is truncated, possibly use pst_cmd instead.
Paul Eggert dce8759f 2018-10-08T16:53:59 fts: cleanup after FTS_NOATIME removal * lib/fts_.h (FTS_VERBATIM, FTS_OPTIONMASK, FTS_NAMEONLY) (FTS_STOP): Shrink to minimal values. We don’t need to worry about binary compatibility in Gnulib, and the old way of doing things had a hole in the user options that caused FTS_OPTIONMASK to not work as desired.
Bernhard Voelker a9c199ed 2018-10-08T16:45:36 fts: remove FTS_NOATIME This reverts commit da4d6974013c822af1498941e32db774b2031765. We cannot guarantee that O_NOATIME works: e.g. openat fails with EPERM if the effective user ID of the caller does not match the owner of the file and the caller is not privileged. Downstream findutils has never picked up FTS_NOATIME. Discussed at <https://lists.gnu.org/r/bug-gnulib/2018-09/msg00122.html>. * lib/fts_.h (FTS_NOATIME): Remove bit flag. (FTS_OPTIONMASK): Adjust. * lib/fts.c (diropen, fts_open, fts_build): Likewise. (fd_ring_check): Likewise.
Bruno Haible 744e2d52 2018-10-09T01:44:07 csharpcomp*, csharpexec*: Remove support for pnet. * m4/csharpcomp.m4 (gt_CSHARPCOMP): Don't test for cscc. Don't set HAVE_CSCC. * build-aux/csharpcomp.sh.in (options_cscc): Remove variable. Don't test HAVE_CSCC. * lib/csharpcomp.c (compile_csharp_using_pnet): Remove function. (compile_csharp_class): Don't invoke it. * m4/csharpexec.m4 (gt_CSHARPEXEC): Don't test for ilrun. Don't set HAVE_ILRUN. * build-aux/csharpexec.sh.in (options_ilrun): Remove variable. Don't test HAVE_ILRUN. * lib/csharpexec.c (execute_csharp_using_pnet): Remove function. (execute_csharp_program): Don't invoke it. * m4/csharp.m4 (gt_CSHARP_CHOICE): Don't recognize --enable-csharp=pnet any more.
Paul Eggert fd04e11f 2018-10-08T11:32:09 autoupdate
Andreas Henriksson c50cf67b 2018-10-07T15:01:07 renameatu: prefer renameat2 to syscall * lib/renameatu.c (renameatu) [HAVE_RENAMEAT2]: Use renameat2 instead of syscall (Bug#32796). * m4/renameat.m4 (gl_FUNC_RENAMEAT): Check for renameat2.
Bruno Haible 4719603f 2018-10-05T21:54:56 strpbrk: Make it possible to namespace the defined symbol. * lib/strpbrk.c (strpbrk): Don't undefine outside of glibc.
Bruno Haible f6b7c876 2018-10-05T21:54:14 strcspn: Make it possible to namespace the defined symbol. * lib/strcspn.c (strcspn): Don't undefine outside of glibc.
Bruno Haible a50f188c 2018-10-05T21:53:24 raise: Make it possible to namespace the defined symbol. * lib/raise.c (raise): Undefine only after the replacement function has been defined. (raise): Renamed from rpl_raise. (raise_nothrow): Move to the end of the compilation unit.
Bruno Haible a738b735 2018-10-05T21:50:47 memcmp: Make it possible to namespace the defined symbol. * lib/memcmp.c (memcmp): Don't undefine outside of glibc.
Bruno Haible a67bce28 2018-10-05T21:49:39 explicit_bzero: Make it possible to namespace the defined symbol. * lib/explicit_bzero.c (explicit_bzero): Don't undefine outside of glibc.
Akim Demaille 5fc612b7 2018-10-02T06:19:19 timevar: rely on gnulib modules for time portability. * modules/timevar (Depends-on): Add sys_time, sys_times, and times. * m4/timevar.m4: Don't check for clock_t and struct tms, guaranteed by gnulib. * lib/timevar.h: Use extern "C" protection. Include <stdio.h> for FILE. * lib/timevar.c: Include sys/time.h, sys/times.h unconditionally, they are guaranteed by gnulib. Remove uses of clock as (now useless) fallback.
Bruno Haible 1ffc70c3 2018-10-05T01:38:46 sh-filename: New module. * m4/sh-filename.m4: New file. * modules/sh-filename: New file. * lib/spawni.c (_PATH_BSHELL): Use BOURNE_SHELL instead of hardcoding "/bin/sh". * tests/test-posix_spawn1.c (main): Likewise. * tests/test-posix_spawn2.c (main): Likewise. * lib/javacomp.c (compile_using_envjavac, is_envjavac_gcj, is_envjavac_gcj43): Likewise. * lib/javaexec.c (execute_java_class): Likewise. * modules/posix_spawn-internal (Depends-on): Add sh-filename. * modules/posix_spawnp-tests (Depends-on): Likewise. * modules/javacomp (Depends-on): Likewise. * modules/javaexec (Depends-on): Likewise.
Bruno Haible 050357c6 2018-10-05T01:16:56 fcntl: Make it possible to namespace the defined symbol, part 2. * lib/fcntl.c: Fix syntax errors in last commit.
Bruno Haible 80d79168 2018-10-05T00:22:57 fcntl: Make it possible to namespace the defined symbol. * lib/fcntl.c (fcntl): Undefine only after the replacement function has been defined. (fcntl): Renamed from rpl_fcntl. (rpl_fcntl_DUPFD, rpl_fcntl_DUPFD_CLOEXEC): New functions, extracted from fcntl. (klibc_fcntl): Move to the end of the compilation unit.
Tom Tromey 6954995d 2018-10-01T14:57:45 mkostemp, mkostemps: Fix compilation error in C++ mode on Mac OS X. Attempting to use the mkostemp module in gdb caused a build failure when using the C++ namespace feature, because mkostemp was not declared. On OS X, mkostemp is declared in unistd.h, so this patch extends the existing special case in stdlib.in.h to cover mkostemp and mkostemps. * lib/stdlib.in.h: Include <unistd.h> for mkostemp and mkostemps on OS X.
Pádraig Brady 7d0bb7b0 2018-09-29T22:20:17 hmac-*: refactor to remove repetitive code A net removal of 240 lines. * lib/hmac.c: A new parameterized single implementation. * lib/hmac-md5.c: Define parameters and include implementation. * lib/hmac-sha1.c: Likewise. * lib/hmac-sha256.c: Likewise. * lib/hmac-sha512.c: Likewise. * modules/crypto/hmac-md5: Reference the new implementation file. * modules/crypto/hmac-sha1: Likewise. * modules/crypto/hmac-sha256: Likewise. * modules/crypto/hmac-sha512: Likewise. * tests/test-hmac-md5.c: Refactor common code to a single function. * tests/test-hmac-sha1.c: Likewise. * tests/test-hmac-sha256.c: Likewise. * tests/test-hmac-sha512.c: Likewise.
Zhang Qing cfc43396 2018-09-29T19:57:56 hmac-sha512: fix hash for keys > blocksize (128 bytes) * lib/hmac-sha512.c (hmac_sha512): Set the computed/shortened key length to that output by sha512, not the blocksize. Otherwise uninitialized data from the stack is used when computing the hash. * tests/test-hmac-sha512.c: Add a shortened key test case. Reported at https://github.com/coreutils/gnulib/pull/5
Bruno Haible 857227b3 2018-09-30T23:16:45 vasnprintf: Avoid warnings from GCC's -Wsign-compare. Reported by Bjarni Ingi Gislason <bjarniig@rhi.hi.is> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-09/msg00105.html>. * lib/vasnprintf.c (VASNPRINTF): Cast 'count' from 'int' to 'unsigned int' before comparison with an unsigned value.
Bruno Haible 8f6ddb47 2018-09-30T19:36:29 timevar: Small tweaks. * lib/timevar.h: Fix comments. Add parameter names to function declarations. * lib/timevar.c: Include timevar.h immediately after config.h. * lib/timevar.def: Fix comments. * modules/timevar (Maintainer): List Akim Demaille.
Akim Demaille fb63c867 2018-09-27T18:20:29 timevar: import from Bison. * m4/timevar.m4, modules/timevar, lib/timevar.h, lib/timevar.c: New files. * lib/timevar.def: New file. * doc/timevar.texi: New file.
Bruno Haible 0782fa4d 2018-09-26T22:14:07 javacomp-script, javacomp: Add preliminary support for Java 12..17. * m4/javacomp.m4 (gt_JAVACOMP): Treat Java versions 12..17 like 11. * lib/javacomp.c (default_target_version): Likewise.
Bruno Haible bd09403f 2018-09-26T11:21:30 javacomp-script, javacomp: Add support for Java 11. * m4/javacomp.m4 (gt_JAVACOMP): Accept source-version 11 and target-version 11. * lib/javaversion.h: Update comments. * lib/javacomp.c (default_target_version, SOURCE_VERSION_BOUND, source_version_index, get_goodcode_snippet, get_failcode_snippet, TARGET_VERSION_BOUND, target_version_index, corresponding_classfile_version): Accept source_version 11 and target_version 11. * lib/javacomp.h: Update comments accordingly.
Bruno Haible 278b4175 2018-09-23T14:13:52 vasnprintf: Fix heap memory overrun bug. Reported by Ben Pfaff <blp@cs.stanford.edu> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-09/msg00107.html>. * lib/vasnprintf.c (convert_to_decimal): Allocate one more byte of memory. * tests/test-vasnprintf.c (test_function): Add another test.
Paul Eggert 09e9ef7b 2018-09-19T14:26:49 mktime: fix _LIBC typo * lib/mktime.c (mktime): Fix typo (misspelled "_LIBC").
Norihiro Tanaka 617a6097 2018-09-19T08:35:49 dfa: optimization for state merge * lib/dfa.c (merge2): New function. (merge_nfa_state): Use it.
Jim Meyering 5007177e 2018-09-18T21:26:01 dfa: trivial comment fix: s/is/if/ * lib/dfa.c (maybe_disable_superset_dfa): Fix comment typo.
Paul Eggert bc7c0f01 2018-09-18T19:12:06 dfa: use more-informative function name * lib/dfa.c (maybe_disable_superset_dfa): Rename from dfautf8noss. Use change.
Paul Eggert 28d7f171 2018-09-18T19:05:26 dfa: tweak allocation performance * lib/dfa.c (merge_nfa_state, dfaoptimize): Prefer ptrdiff_t for indexes some more. Use char for flags, as it’s wide enough. Allocate queue and flags together, with one malloc call. No need to use xnmalloc since the multiplication and addition cannot overflow (it’s already been checked by earlier allocation). Prefer memset to open-coding.
Paul Eggert cbf5523b 2018-09-18T18:24:27 dfa: prune states as we go * lib/dfa.c (prune): Remove. (merge_nfa_state): Prune as we go instead of at the end. Prefer ptrdiff_t for indexes, as this helps the compiler a bit. Simplify constraint checking a bit.
Paul Eggert 5eae16cf 2018-09-18T15:25:51 dfa: reorder enum for efficiency * lib/dfa.c (END): Now -1 again. Reorder other elements of the enumeration to make it easier for GCC to generate efficient code by using fewer comparisons to check for ranges of values. (atom): Take advantage of the reordering.
Norihiro Tanaka 4299106c 2018-09-18T10:07:23 dfa: optimize alternation in NFA Even when similar states exist in alternation, the DFA treats them as separate items, which may complicate the transition in NFA and cause slowdown. This change assembles the states into one. For example, ab|ac is changed into a(b|c). This change speeds-up matching for many branched patterns. For example, grep speeds up more than 30× in: seq 10000 | sed 's/$/ abcdefghijklmnopqrstuvwxyz/; s/$/./' >in time -p env LC_ALL=C grep -vf in in * lib/dfa.c (prune): New function. (merge_nfa_state): New function. It merges similar NFA states. (dfaoptimize): New function. It seeks merged and removed nodes. (dfaanalyze): Call new function. (dfautf8noss): Change name from dfaoptimize because of addition of new function. (dfacomp): Update caller.
Norihiro Tanaka e648401b 2018-09-18T09:58:22 dfa: simplify initial state Simplifying the initial state enables easier optimization of the NFA. * lib/dfa.c (enum token): Add new element BEG. (prtok): Adjust due to adding element BEG. (dfaparse): Put BEG at a head of tokens. (state_index): Adjust due to adding element BEG. (dfaanalyze): Concatenate BEG to other tokens, and simplify to build initial state. (dfamust): Adjust due to adding element BEG. DFAMUST ignores it.
Bruno Haible f88c93f4 2018-09-18T22:58:23 file-has-acl: Fix test failure on Cygwin 2.9. * m4/acl.m4 (gl_FUNC_ACL): Update comments regarding Cygwin. * lib/acl-internal.h: Likewise. (HAVE_ACL_EXTENDED_FILE): Undefine on Cygwin. * lib/acl-internal.c: Update comments regarding Cygwin. * lib/acl_entries.c: Likewise. * lib/file-has-acl.c: Likewise. (file_has_acl): For Cygwin, use a different way to determine whether the "default" ACL of a directory is nontrivial. * lib/get-permissions.c: Update comments regarding Cygwin. * lib/set-permissions.c: Likewise.
Paul Eggert 36a092b8 2018-09-18T12:19:02 gettime: nanotime never existed Problem reported by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2018-09/msg00082.html * lib/gettime.c (gettime) [HAVE_NANOTIME]: Remove unused code. * m4/gettime.m4 (gl_GETTIME): Don’t check for nanotime.
Paul Eggert 0a1ced59 2018-09-16T14:41:36 timespec: new function current_timespec * lib/gettime.c (gettime): Prefer clock_gettime to nanotime, and don’t worry about it failing on a CLOCK_REALTIME arg. POSIX requires it to succeed and I don’t know of any counterexamples where the fallbacks would work. (current_timespec): New function, taken from Emacs. It is more convenient than gettime, and can help register allocation. * lib/timespec.h: Include arg-nonnull.h. (current_timespec): New declaration. (gettime, settime): Declare args to be nonnull. * modules/timespec (Depends-on): Add snippet/arg-nonnull.
Bruno Haible 6642aeb4 2018-09-16T19:12:44 setlocale: Improve locale handling on macOS 10.12 or newer. * lib/setlocale.c: Include header files for CoreFoundation. Declare gl_locale_name_canonicalize. (libintl_setlocale): Try harder to set a locale for categories LC_CTYPE and LC_MESSAGES. * m4/setlocale.m4 (gl_PREREQ_SETLOCALE): Add comment.
Bruno Haible b0af89dc 2018-09-16T17:14:12 Update list of locale names with scripts on macOS. * lib/localename.c (gl_locale_name_canonicalize): Update tables to match Mac OS X 10.13 and recent glibc.
Bruno Haible c5804133 2018-09-16T14:42:55 localename: Revisit macOS specific code. * lib/localename.c (gl_locale_name_default): Reduce code duplication. Fix comments about Mac OS X versions.
Bruno Haible 6321552c 2018-09-16T03:15:54 setlocale: Improve support for locales not supported by libc. Reported by Dapeng Gao <peter@dpgao.cc> at <https://savannah.gnu.org/bugs/?54479>. * gettext-runtime/intl/setlocale.c: Include <stdio.h>. (libintl_setlocale): Use a more error-tolerant strategy when the locale to be set is not supported by libc: Emit warnings instead of failing.
Paul Eggert 8e827467 2018-09-11T12:42:31 xstrtol: actually copy the intprops.h line
Paul Eggert 2f799e51 2018-09-11T12:29:01 xstrtol: fix missing-TYPE_SIGNED typo * lib/xstrtol.c (TYPE_SIGNED): New macro, duplicating intprops.h.
Paul Eggert b021c53f 2018-09-10T18:42:25 timespec: fix resolution confusion In normal usage, clock resolution is given in seconds, but the code was mistakenly using inverse seconds and calling it “resolution”. Fix this, partly by renaming two identifiers. The old names will be kept for a bit, to ease transition. * lib/timespec.h (TIMESPEC_HZ, LOG10_TIMESPEC_HZ): New constants, replacing TIMESPEC_RESOLUTION and LOG10_TIMESPEC_RESOLUTION, which are now obsolescent. All uses changed.
Paul Eggert 8b55a442 2018-09-09T08:56:15 mktime: simplify in prep for glibc merge * lib/mktime.c, lib/timegm.c [_LIBC]: Include mktime-internal.h (a small file just for glibc) instead of using a typedef.
Paul Eggert 448d38da 2018-09-07T17:13:59 intprops: minor clarification of code * lib/intprops.h (_GL_BINARY_OP_OVERFLOW): Use _GL_INT_CONVERT rather than reinventing it.
Bruno Haible 86b1dc89 2018-09-07T23:35:52 posix_spawn_file_actions_addchdir: New module. Suggested by Eric Blake in <https://lists.gnu.org/archive/html/bug-findutils/2018-09/msg00007.html>. * lib/spawn.in.h (posix_spawn_file_actions_addchdir): New declaration. * lib/spawn_int.h (struct __spawn_action): Add tag 'spawn_do_chdir' and union member 'chdir_action'. * lib/spawn_faction_addchdir.c: New file. * lib/spawni.c (__spawni): Implement the spawn_do_chdir action. * lib/spawn_faction_addclose.c: Test REPLACE_POSIX_SPAWN instead of HAVE_WORKING_POSIX_SPAWN. * lib/spawn_faction_adddup2.c: Likewise. * lib/spawn_faction_addopen.c: Likewise. * m4/posix_spawn_faction_addchdir.m4: New file. * m4/posix_spawn.m4 (gl_POSIX_SPAWN_BODY): Test whether module 'posix_spawn_file_actions_addchdir' is present and whether posix_spawn_file_actions_addchdir_np exists. Define REPLACE_POSIX_SPAWN instead of HAVE_WORKING_POSIX_SPAWN. * m4/spawn_h.m4 (gl_SPAWN_H): Test whether posix_spawn_file_actions_addchdir is declared. (gl_SPAWN_H_DEFAULTS): Initialize GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR, HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR, REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR. * modules/spawn (Makefile.am): Substitute GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR, HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR, REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR. * modules/posix_spawn_file_actions_addchdir: New file. * modules/posix_spawn_file_actions_addclose (Depends-on, configure.ac): Test also REPLACE_POSIX_SPAWN. * modules/posix_spawn_file_actions_adddup2 (Depends-on, configure.ac): Likewise. * modules/posix_spawn_file_actions_addopen (Depends-on, configure.ac): Likewise. * tests/test-spawn-c++.cc (posix_spawn_file_actions_addchdir): Check signature. * doc/posix-functions/posix_spawn.texi: Mention the new module. * doc/posix-functions/posix_spawnp.texi: Likewise.
Bruno Haible e41da810 2018-09-07T09:57:25 Fix typo in comment in yesterday's commit.
Bruno Haible c4af52ba 2018-09-06T18:36:02 fcntl: Fix F_DUPFD_CLOEXEC behaviour on Haiku. * lib/fcntl.c (rpl_fcntl): For F_DUPFD_CLOEXEC, don't even try the system fcntl. * doc/posix-functions/fcntl.texi: Document the issue.
Bruno Haible c4b2df3e 2018-09-06T14:46:06 xstrtoll: Rely on limits-h module. * lib/xstrtol.c: Don't include intprops.h. (ULLONG_MAX, LLONG_MAX, LLONG_MIN): Remove fallback definitions. * modules/xstrtol (Depends-on): Remove 'intprops'. * modules/xstrtoll (Depends-on): Add 'limits-h'.
Bruno Haible 05e49b15 2018-09-06T14:41:00 strtoll, strtoull: Rely on limits-h module. * lib/strtol.c (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove macros. (ULLONG_MAX, LLONG_MAX, LLONG_MIN): Remove fallback definitions. * modules/strtoll (Depends-on): Add limits-h. * modules/strtoull (Depends-on): Likewise.
Bruno Haible 09b59d28 2018-09-06T14:28:38 limits-h: Provide numerical limits macros. * lib/limits.in.h (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Define also for IRIX and for GCC. (WORD_BIT, LONG_BIT): Define. * m4/limits-h.m4 (gl_LIMITS_H): Set LIMITS_H to non-empty also when <limits.h> does not define LLONG_MAX or WORD_BIT. * tests/test-limits-h.c (TYPE_SIGNED, TYPE_WIDTH, TYPE_MINIMUM, TYPE_MAXIMUM): New macros, from intprops.h. Add tests for CHAR_BIT, WORD_BIT, LONG_BIT, <type>_MIN, and <type>_MAX. * doc/posix-headers/limits.texi: Document what the 'limits-h' module provides.
Bruno Haible 8ac1b3f7 2018-09-06T11:23:53 fcntl: Don't access nonexistent optional argument. Reported by Frank Busse <f.busse@imperial.ac.uk> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-09/msg00018.html>. * lib/fcntl.c (rpl_fcntl): For actions that don't take an argument, don't consume an argument. For actions that take an 'int' argument, consume an 'int' argument.
Paul Eggert 1cb440df 2018-09-02T02:53:31 mktime: fix unlikely race+overflow bug Problem reported by Alexandre Oliva in: https://sourceware.org/bugzilla/show_bug.cgi?id=16346 * lib/mktime.c (__mktime_internal): Access *OFFSET only once, to avoid an unlikely race if the compiler delays a load and if this cascades into a signed integer overflow.
Paul Eggert 15343c31 2018-08-31T18:02:48 mktime, timegm: simplify glibc time64_t * lib/mktime.c, lib/timegm.c (mktime_offset_t) [_LIBC]: Now long int, not time_t, since long int is the longstanding type for this in glibc and there is no need to change it even if time_t becomes 64 bits - even int would do, though this would be a change to the glibc generated code. When this change is merged into glibc, it should simplify the time_t vs time64_t situation.
Paul Eggert 65d3c969 2018-08-31T18:02:48 mktime, timegm: simplify merge to glibc Move code around to make a merge to glibc easier to audit. This should not change behavior. * lib/mktime.c: Include more standard files unconditionally. (NEED_MKTIME_INTERNAL, NEED_MKTIME_WINDOWS) (NEED_MKTIME_WORKING): Give default values to pacify -Wundef, which glibc uses. Default NEED_MKTIME_WORKING to DEBUG_MKTIME, to simplify later conditionals; default the others to zero. In uses of these conditionals, explicitly spell out how _LIBC affects things, so it’s easier to review from a glibc viewpoint. (my_tzset, __tzset) [!_LIBC]: New function and macro, to better compartmentalize tzset issues. Move system-dependent tzsettish code here from mktime. (mktime): Move tzsettish code to my_tzset, and move localtime_offset to within mktime so that it doesn’t need a separate ifdef. * lib/mktime-internal.h (__gmtime_r, __localtime_r, __mktime_internal): Move these macros here from lib/mktime.c and lib/gmtime.c.
Paul Eggert 5c93a6b6 2018-08-27T18:31:44 intprops: avoid evaluation of some expressions This makes EXPR_SIGNED (e) easier to use, as it no longer evaluates the expression E. Formerly, E was required to be free of side effects. * lib/intprops.h (_GL_INT_CONVERT, _GL_INT_NEGATE_CONVERT) (EXPR_SIGNED, TYPE_WIDTH, _GL_INT_MINIMUM, _GL_INT_MAXIMUM) (_GL_SIGNED_INT_MAXIMUM): Do not evaluate the expression arg.
Paul Eggert 53e2c179 2018-08-25T20:40:55 autoupdate
Paul Eggert bbc292e3 2018-08-22T17:59:49 ; autoupdate
Bruno Haible 3d8634f1 2018-08-19T14:14:17 getpass: Move declaration to <unistd.h>. * lib/unistd.in.h (getpass): New declaration. * lib/getpass.h: Replace with a stub that just includes <unistd.h>. * m4/getpass.m4 (gl_FUNC_GETPASS): Declare through AC_DEFUN_ONCE. Require gl_UNISTD_H_DEFAULTS. Don't test whether getpass is declared. (gl_FUNC_GETPASS_GNU): Require gl_UNISTD_H_DEFAULTS and gl_FUNC_GETPASS. On glibc systems, don't set REPLACE_GETPASS to 1. * modules/getpass (Depends-on): Add 'unistd'. (configure.ac): Test also REPLACE_GETPASS. Define a module indicator. (Include): Specify <unistd.h> instead of "getpass.h". * modules/getpass-gnu (Depends-on): Merely depend on 'getpass'. (configure.ac): Sync with the configure.ac section of modules/getpass. (Include): Specify <unistd.h> instead of "getpass.h". * m4/unistd_h.m4 (gl_UNISTD_H): Test whether getpass is declared. (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_GETPASS, HAVE_GETPASS, REPLACE_GETPASS. * modules/unistd (Makefile.am): Substitute GNULIB_GETPASS, HAVE_GETPASS, REPLACE_GETPASS. * tests/test-unistd-c++.cc: Test also the declaration of 'getpass'. * doc/glibc-functions/getpass.texi: A length limit exists also on uClibc and musl. * NEWS: Mention the change.
Bruno Haible 4021aac5 2018-08-19T12:03:27 glob: Fix over-optimization due to attribute __nonnull__. * lib/glob.c (_GL_ARG_NONNULL): Define to empty.
Bruno Haible ed1c87c6 2018-08-18T23:26:06 Avoid -Wcast-function-type warnings from casts after GetProcAddress. Reported by Andy Moreton <andrewjmoreton@gmail.com> in <https://lists.gnu.org/archive/html/emacs-devel/2018-08/msg00468.html>. Solution proposed by Eli Zaretskii. * lib/getaddrinfo.c (GetProcAddress): Cast result to 'void *' first. * lib/gettimeofday.c (GetProcAddress): Likewise. * lib/link.c (GetProcAddress): Likewise. * lib/physmem.c (GetProcAddress): Likewise. * lib/poll.c (GetProcAddress): Likewise. * lib/select.c (GetProcAddress): Likewise. * lib/stat-w32.c (GetProcAddress): Likewise.
Bruno Haible 35d32814 2018-08-18T23:32:14 glob: Fix another compilation error when glob.h is not replaced. Reported and fix proposed by Reuben Thomas <rrt@sc3d.org> again. * lib/globfree.c: Include <libc-config.h>.
Bruno Haible c2ec61d9 2018-08-18T22:44:28 glob: Fix compilation error when glob.h is not replaced. Reported and fix proposed by Reuben Thomas <rrt@sc3d.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00096.html>. * lib/glob_pattern_p.c: Include <libc-config.h>. * modules/glob (Depends-on): Add libc-config.
Bruno Haible ba153ed1 2018-08-18T21:35:11 scratch_buffer: Fix include file. Reported by Reuben Thomas <rrt@sc3d.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00082.html>. * lib/scratch_buffer.h: Include <libc-config.h> first. Add double-inclusion guard.
Bruno Haible 1945403c 2018-08-11T20:23:37 setlocale: Trivial simplification. * lib/setlocale.c (setlocale_unixlike): Remove redundant #if.
Paul Eggert 3357fb49 2018-08-11T18:56:40 verify: port 'assume' to traditional tools * lib/verify.h (assume): Port better to Oracle Studio 12.6 and other tools that use /*NOTREACHED*/ comments.
Bruno Haible 69ac3f3e 2018-08-11T02:23:48 fnmatch: Fix compilation error in C++ namespace mode on Mac OS X. * modules/fnmatch-gnu (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/fnmatch.in.h (fnmatch): Skip _GL_CXXALIASWARN if module 'fnmatch-gnu' is in use.
Paul Eggert 1261513a 2018-08-10T14:28:55 autoupdate
Bruno Haible 490c345b 2018-08-07T10:43:06 glob-h: New module. * lib/glob.in.h: Use nearly the usual gnulib idioms for header file replacements. * lib/glob.c: Include <config.h>. * m4/glob_h.m4: New file. * m4/glob.m4 (gl_GLOB): Require gl_GLOB_H. Remove code that is moved to glob_h.m4. Set HAVE_GLOB, REPLACE_GLOB, HAVE_GLOB_PATTERN_P, REPLACE_GLOB_PATTERN_P as appropriate. (gl_PREREQ_GLOB): Don't require AC_C_RESTRICT and AC_USE_SYSTEM_EXTENSIONS, now done through module 'glob-h'. * modules/glob-h: New file. * modules/glob (Files): Remove lib/glob.in.h, lib/glob-libc.h. (Dependencies): Add glob-h. Remove extensions, snippet/*, libc-config, lstat, sys_stat. Change conditions. (configure.ac): Test HAVE_GLOB, REPLACE_GLOB, HAVE_GLOB_PATTERN_P, REPLACE_GLOB_PATTERN_P. Set module indicator. (Makefile.am): Remove code that is moved to glob-h. * doc/posix-headers/glob.texi: Mention the 'glob-h' module. * modules/posixcheck (Depends-on): Add glob-h.
Bruno Haible c6d92bd5 2018-08-07T00:25:13 fnmatch-h: Fix test compilation error on mingw (regression from today). * lib/fnmatch.in.h: Fix conditions.
Bruno Haible 08096928 2018-08-06T15:00:38 fnmatch-h: New module. * lib/fnmatch.in.h: Use the usual gnulib idioms for header file replacements. (FNM_*): Don't redefine if fnmatch exists and we are not overriding it. (fnmatch): Use the usual gnulib idiom for function declarations. Enable 'posixcheck' warning. * m4/fnmatch_h.m4: New file. * m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Require gl_FNMATCH_H. Remove code that is moved to fnmatch_h.m4. When fnmatch does not exist, don't bother testing whether it is working. Set HAVE_FNMATCH, REPLACE_FNMATCH as appropriate. * modules/fnmatch-h: New file. * modules/fnmatch (Files): Remove lib/fnmatch.in.h. (Dependencies): Add fnmatch-h. Remove extensions, snippet/*. Change conditions. (configure.ac): Test HAVE_FNMATCH and REPLACE_FNMATCH. Set module indicator. (Makefile.am): Remove code that is moved to fnmatch-h. * modules/fnmatch-gnu (configure.ac): Test HAVE_FNMATCH and REPLACE_FNMATCH. * doc/posix-headers/fnmatch.texi: Mention the 'fnmatch-h' module. * modules/posixcheck (Depends-on): Add fnmatch-h.
Bruno Haible 0998a7c6 2018-08-05T22:51:45 iconv-h: Enable 'posixcheck' warnings. * m4/iconv_h.m4 (gl_ICONV_H): Check for declarations of iconv and iconv_open. * lib/iconv.in.h (iconv_open, iconv): Use _GL_WARN_ON_USE.
Bruno Haible efb15adf 2018-08-05T14:06:08 Fix link error regarding 'rpl_environ' (regression from 2012-11-21). * m4/extern-inline.m4: Add more comments. * lib/warn-on-use.h (_GL_WARN_ON_USE_ATTRIBUTE): New macro. * lib/unistd.in.h (rpl_environ): Use it instead of _GL_WARN_ON_USE. * lib/math.in.h (_GL_WARN_REAL_FLOATING_DECL): Likewise.
Assaf Gordon c5e76a95 2018-08-01T22:14:21 dfa: fix memory leak * lib/dfa.c (dfafree): Add missing free() on dfa->superset.
Paul Eggert 80d1e862 2018-08-01T16:08:26 ieee754-h: new module It looks like Emacs can use this for some NaN processing. Emacs uses it only on double NaNs so it should be safe. * MODULES.html.sh (func_all_modules): Add ieee754-h. * config/srclist.txt: Mention ieee754.h in a comment. * doc/glibc-headers/ieee754.texi (ieee754.h): Gnulib now has a substitute that should work except for long double and for non-IEEE platforms. * lib/ieee754.in.h, m4/ieee754-h.m4, modules/ieee754-h: * modules/ieee754-h-tests, tests/test-ieee754-h.c: New files.
Paul Eggert 66b99e52 2018-08-01T13:26:38 autoupdate
Paul Eggert 5b78831d 2018-07-13T00:46:08 autoupdate
Simon Marchi 76b8ad44 2018-07-09T19:03:46 mkancesdirs: Add extern "C" to header * lib/mkancesdirs.h: Add extern "C".
Paul Eggert 2522322e 2018-07-05T09:22:09 renameatu: rename from renameat2 It's looking like Glibc will add a renameat2 function that is incompatible with Gnulib renameat2; see: https://sourceware.org/ml/libc-alpha/2018-07/msg00064.html To help avoid future confusion, rename renameat2 to something else. Use the name 'renameatu', as the Gnulib function is close to the Glibc function. Perhaps someday there will also be a renameat2 Gnulib module, which mimicks the future glibc renameat2, but that can wait as nobody seems to need such a module now. * NEWS: Mention this. * lib/renameatu.c: Rename from lib/renameat2.c. * lib/renameatu.h: Rename from lib/renameat2.h. * modules/renameat2: Rename from modules/renameatu. * modules/renameat2-tests: Rename from modules/renameat2-tests. All uses of "renameat2" in identifiers or file name changed to "renameatu", except for two instances in lib/renameatu.c that deal with the Linux kernel's renameat2 syscall.
Paul Smith 62d06fd3 2018-07-01T18:00:52 getloadavg: don't redefine WINDOWS32 * lib/getloadavg.c: Only define WINDOWS32 if it's not already defined.
Paul Eggert 5508825f 2018-06-29T15:34:57 regex: glibc does not use intprops.h Maybe we can talk glibc into using intprops.h someday, but now doesn’t seem to be a good time. * lib/regcomp.c (TYPE_SIGNED): Remove; regex_internal.h now defines. * lib/regex_internal.h [_LIBC]: Do not include intprops.h. (TYPE_SIGNED, INT_ADD_WRAPV): New macros.
Paul Eggert f59be416 2018-06-28T12:23:31 regex: port to recently proposed glibc regex merge This patch is inspired by Adhemerval Zanella's recent proposal https://www.sourceware.org/ml/libc-alpha/2018-06/msg00905.html to merge glibc and Gnulib regex. It aims to simplify the merge on the glibc side, without keeping Gnulib portable. * lib/regex.h: Fix a problem with glibc installed-header checking, as follows: (_Restrict_): Prefer __restrict if defined or if GCC 2.95 or later. (_Restrict_arr_): Prefer __restrict_arr if defined, otherwise prefer _Restrict_ if C99 or GCC 3.1 or later (but not C++). * lib/regex_internal.c (re_string_realloc_buffers, build_wcs_buffer) (build_wcs_upper_buffer, build_upper_buffer) (re_string_translate_buffer, re_string_context_at): Move decls here from lib/regex_internal.h, for glibc internal tests. (build_wcs_upper_buffer): Use __wcrtomb, not wcrtomb, fixing glibc BZ #18496. * lib/regex_internal.h (lock_fini) [_LIBC]: Cast to 0 to pacify -Wunused-value. (bitset_set, bitset_clear, bitset_contain, bitset_empty) (bitset_set_all, bitset_copy, bitset_not, bitset_merge) (bitset_mask): Now static inline, and without any __attribute__ ((unused)) decoration, for glibc internal tests.
Bruno Haible d7cf3b8d 2018-06-25T21:45:23 Continue to use spaces for indentation, not tabs.
Jim Meyering ed78f0e0 2018-06-25T08:28:12 acl-internal.h: remove _GL_ATTRIBUTE_CONST on void function * lib/acl-internal.h (free_permission_context): Remove that attribute directive. Otherwise, it would provoke this from GCC 9: lib/acl-internal.h:300:3: error: 'const' attribute on function \ returning 'void' [-Werror=attributes]
Jim Meyering 0b4e1419 2018-06-24T20:47:58 parse-datetime: accommodate gcc-4.8.5 Bruno Haible reported the build failure in https://lists.gnu.org/r/bug-gnulib/2018-06/msg00066.html * lib/parse-datetime.y (parse_datetime2): Remove leading "static" on declaration of new local.
Bruno Haible 013b9158 2018-06-25T04:18:30 af_alg: Fail in continuable manner on Linux/powerpc64le. Reported by Assaf Gordon <assafgordon@gmail.com> in <https://lists.gnu.org/archive/html/coreutils/2018-06/msg00034.html>. * lib/af_alg.c (afalg_stream): On non-seekable streams, try a single- byte send() as the first round.
Bruno Haible c08a99b5 2018-06-25T00:41:03 af_alg: Fix state of stream after sendfile() succeeds. * lib/af_alg.c (afalg_stream): Invoke fflush and lseek, to ensure that the stream is correctly positioned afterwards. * modules/crypto/af_alg (Depends-on): Add fflush. * tests/test-digest.h (test_digest_on_files): Verify that after the operation the stream is positioned at end of file.
Jim Meyering e86c5da6 2018-06-24T16:54:43 canon-host: take GCC9's advice rather than ignoring warning Pádraig Brady suggested not to ignore this GCC9 advice. * lib/canon-host.c: Undo preceding change. * lib/canon-host.h: Instead, declare with _GL_ATTRIBUTE_MALLOC.
Jim Meyering 0b8875c1 2018-06-24T15:58:09 parse-datetime.y: avoid spurious GCC 9 warning * lib/parse-datetime.y (parse_datetime2): Save RELATIVE_TIME_0 into a function local prior to the first "goto fail". The prior use would evoke this: parse-datetime.y: In function 'parse_datetime2': parse-datetime.y:1791:19: error: jump skips variable initialization \ [-Werror=jump-misses-init] parse-datetime.y:2385:2: note: label 'fail' defined here parse-datetime.y:188:43: note: '({anonymous})' declared here parse-datetime.y:1841:12: note: in expansion of macro 'RELATIVE_TIME_0'
Jim Meyering decdd868 2018-06-24T11:51:48 canon-host.c: avoid spurious GCC 9 warning * lib/canon-host.c: Suppress GCC9's -Wsuggest-attribute=malloc.
Pádraig Brady a79bb41b 2018-06-24T15:15:16 maint: clarify comments about sticky EOF * lib/af_alg.c: Be more direct that we can't assume stickiness of EOF for portability reasons. * lib/md5.c: Clarify that this isn't just a glibc issue. * lib/sha1.c: Likewise. * lib/sha256.c: Likewise. * lib/sha512.c: Likewise.
Bruno Haible 20841b57 2018-06-25T00:25:31 af_alg: Comment and style improvements. * lib/af_alg.c (alg_socket): Use 'size_t' as index into a string. (afalg_buffer, afalg_stream): Improve comments.
Pádraig Brady 20c91856 2018-06-24T01:46:10 af_alg: avoid hangs when reading from streams * lib/af_alg.c (afalg_stream): Don't assume EOF is sticky, and thus avoid doing a fread() when feof() is set. * lib/md5.c: Ensure feof() is called before fread(). * lib/sha1.c: Likewise. * lib/sha256.c: Likewise. * lib/sha512.c: Likewise.
Pádraig Brady 42085232 2018-06-24T01:29:55 af_alg: fix error handling when hash not returned * lib/af_alg.c (afalg_stream): Handle the case where we've successfully written data to the kernel in the read/write loop, but the kernel doesn't respond with the hash.