summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* pmccabe2html: Doc fix.Simon Josefsson2022-08-162-5/+11
| | | | | * build-aux/pmccabe2html: Don't use reserved _SOURCES namespace. Use AM_V_GEN. Use LC_ALL=C.
* stdbool: Drop old BeOS support that gets in the way of ISO C 23 support.Bruno Haible2022-08-152-21/+9
| | | | * lib/stdbool.in.h: Don't include <OS.h>.
* tempname: Fix a comment.Bruno Haible2022-08-152-1/+7
| | | | | * lib/tempname.c (try_tempname_len): Use of entropy makes the function more, not less, secure.
* tempname: remove incorrect commentPaul Eggert2022-08-153-2/+8
| | | | | * lib/tempname.c, lib/tempname.h: Remove incorrect comment, as the names are not necessarily hard to predict (Bug#57129).
* bootstrap.conf: Use proper shell marker for Emacs.Simon Josefsson2022-08-142-1/+6
| | | | * build-aux/bootstrap.conf: Add it.
* stdbool: port to C23Paul Eggert2022-08-133-75/+84
| | | | | | | | | | | | * m4/stdbool.m4 (AC_CHECK_HEADER_STDBOOL): Copy from bleeding-edge Autoconf. Don’t define if Autoconf 2.72 or later. * tests/test-stdbool.c (bool, false, true) (__bool_true_false_are_defined): Do not require these to be defined. C23 still requires __bool_true_false_are_defined but marks it as obsolescent, and it’s no longer worth testing. (WORKING_BOOL): New macro, which also tests __STDC_VERSION__. Use it in tests for working bool. Test for bool instead of for _Bool, which C23 says is obsolescent.
* gnulib-tool.py: Fix some code generation details.Bruno Haible2022-08-132-38/+35
| | | | | | | | | | * pygnulib/GLEmiter.py: Don't produce Windows CR-LFs on Windows. (GLEmiter.po_Makevars): Emit a definition of top_builddir, not top_subdir. (GLEmiter.po_POTFILES_in): Fix result when sourcebase is 'tests' or something like that. (GLEmiter.initmacro_start): Add two more newlines (mistake from 2021-04-11).
* gnulib-tool.py: Reduce code duplication.Bruno Haible2022-08-134-24/+29
| | | | | | | * pygnulib/constants.py (relinverse): New function. * pygnulib/GLEmiter.py (GLEmiter.po_Makevars, GLEmiter.tests_Makefile_am): Use it. * pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.
* hamt: fix technically undefined behaviorMarc Nieper-Wißkirchen2022-08-122-0/+13
| | | | | | | Bug reported by Bruno Haible in <https://lists.gnu.org/r/bug-gnulib/2022-04/msg00023.html>. * lib/hamt.c (entry_insert): Remove technically undefined behavior when shifting an integer of N bits by N or more bits.
* stdckdint: fix dependencyPaul Eggert2022-08-102-0/+5
| | | | | * modules/stdckdint (Depends-on): Add stdbool. Reported by Bruno Haible.
* maint: parenthesize macro definiensPaul Eggert2022-08-104-5/+14
| | | | | | | | * lib/intprops.h (INT_ADD_OK, INT_SUBTRACT_OK, INT_MULTIPLY_OK): * lib/pipe-filter-ii.c (GetLastError): * lib/thread-optim.h (gl_multithreaded): Parenthesize function-like macro definiens beginning with a unary operator; needed for weird invocations like ‘m (...)[p]’.
* stdckdint: prefer to intprops when easyPaul Eggert2022-08-1020-35/+50
| | | | | | | | | | | | | | | | | stdckdint.h is part of draft C23 and therefore is more likely to be familiar to programmers in the future, so prefer it to intprops.h in files that don’t need non-_WRAPV intprops.h macros. * lib/alignalloc.c, lib/backupfile.c, lib/fnmatch.c, lib/fnmatch_loop.c: * lib/group-member.c, lib/malloca.c, lib/posixtm.c, lib/reallocarray.c: * lib/xmalloc.c: For files that can use stdckdint.h just as easily as intprops.h, include the former instead of the latter, and use the former’s ckd_* macros instead of the latter’s *_WRAPV macros. * modules/alignalloc, modules/backup-rename, modules/backupfile: * modules/fnmatch, modules/group-member, modules/malloca: * modules/posixtm, modules/reallocarray: * modules/relocatable-prog-wrapper, modules/xalloc: Depend on stdckdint instead of intprops.
* stdckdint-h: new modulePaul Eggert2022-08-1011-13/+238
| | | | | | | | | | | | | | | | | | | | | | | This supports draft C23 <stdckdint.h>. * doc/posix-headers/stdckdint.texi: * lib/stdckdint.in.h, modules/stdckdint: * modules/stdckdint-tests, tests/test-stdckdint.c: New files. * MODULES.html.sh, doc/gnulib.texi: Update for new module. * lib/intprops-internal.h: Include <stdckdint.h> if C23 and its macros would help and our substitute has not already started to be included. (_GL_INT_ADD_WRAPV, _GL_INT_SUBTRACT_WRAPV) (_GL_INT_MULTIPLY_WRAPV): Use ckd_add, ckd_sub, ckd_mul if they are defined and would help. * lib/intprops-internal.h, lib/intprops.h: Improve comments. The C23 restrictions on stdckdint macros already mostly applied to intprops.h, so these are clarifications, not further restrictions. * tests/test-intprops.c: If TEST_STDCKDINT is defined, include <stdckdint.h> instead of "intprops.h", and test it instead. (VERIFY) [TEST_STDCKDINT]: Ignore the arg in this case. (main) [TEST_STDCKDINT]: Skip tests irrelevant to stdckdint.h.
* intprops: refactor intprops.h into twoPaul Eggert2022-08-104-323/+399
| | | | | | | | | | | | | | | | | | | | * lib/intprops.h: Include new file intprops-internal.h. (_GL_INT_CONVERT, _GL_INT_NEGATE_CONVERT, _GL_INT_MINIMUM) (_GL_INT_MAXIMUM, _GL_SIGNED_INT_MAXIMUM, LLONG_MAX, LLONG_MIN) (_GL_HAVE___TYPEOF__, _GL_SIGNED_TYPE_OR_EXPR) (_GL_HAS_BUILTIN_ADD_OVERFLOW, _GL_HAS_BUILTIN_MUL_OVERFLOW) (_GL_HAS_BUILTIN_OVERFLOW_P, _GL__GENERIC_BOGUS) (_GL_INT_OP_WRAPV, _GL_INT_OP_WRAPV_LONGISH, _GL_INT_OP_CALC) (_GL_INT_OP_WRAPV_VIA_UNSIGNED, _GL_INT_ADD_RANGE_OVERFLOW) (_GL_INT_SUBTRACT_RANGE_OVERFLOW) (_GL_INT_MULTIPLY_RANGE_OVERFLOW): Move to intprops-internal.h. (TYPE_SIGNED, EXPR_SIGNED, TYPE_WIDTH, INT_NEGATE_RANGE_OVERFLOW) (INT_NEGATE_OVERFLOW, INT_ADD_WRAPV, INT_SUBTRACT_WRAPV) (INT_MULTIPLY_WRAPV): Rename to _GL_ prefix, move to intprops-internal.h, and define here in terms of the _GL_ name. * lib/intprops-internal.h: New file, containing the above. * modules/intprops (Files): Add lib/intprops-internal.h.
* intprops: refactor _GL_HAS_BUILTIN_OVERFLOW_PPaul Eggert2022-08-102-7/+13
| | | | | | | * lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_P) [_GL_HAS_BUILTIN_OVERFLOW_P]: Use __builtin_sub_overflow_p directly rather than indirectly via INT_SUBTRACT_OVERFLOW. This simplifies future changes, and doesn’t change the generated code.
* verify: port ‘assume’ to C23 non-GCCPaul Eggert2022-08-102-2/+11
| | | | | * lib/verify.h (assume): Use C23's unreachable if available and if GCC and/or MSC primitives are not available.
* gnulib-tool.py: Finish implementing option --conditional-dependencies.Bruno Haible2022-08-107-63/+148
| | | | | | | | | | | | | | | | | | | | | * gnulib-tool.py (main) Accept options --conditional-dependencies, --no-conditional-dependencies. * pygnulib/GLModuleSystem.py (GLModuleTable.addConditional): Use str(module), not module, as key. Fix logic bug. (GLModuleTable.getCondition): Simplify. (GLModuleTable.transitive_closure): Show a warning when there are duplicate dependencies. Fix logic bug. (GLModuleTable.transitive_closure_separately): Simplify. (GLModuleTable.add_dummy): Ignore tests modules. Cope with multiple lib_SOURCES augmentation lines. Cope with comments at the end of a lib_SOURCES augmentation line. Add the dummy module at the end of the modules list. * pygnulib/GLTestDir.py (GLTestDir.execute): Remove the code that forces the dummy module to the end of the list. * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Add code to terminate the shell functions. Add code for the dependencies from the unconditional to the conditional modules. Don't emit AM_CONDITIONAL for unconditional modules.
* gnulib-tool.py: Don't do license replacements in the autoconf snippets.Bruno Haible2022-08-094-44/+29
| | | | | | | | | * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippet): Remove fileassistant argument. Don't invoke the 'aux' transformer here. Don't produce Windows CR-LFs on Windows. (GLEmiter.autoconfSnippets): Remove fileassistant argument. * pygnulib/GLImport.py (GLImport.gnulib_comp): Update all callers. * pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.
* gnulib-tool.py: Fix some code generation details.Bruno Haible2022-08-093-114/+125
| | | | | | | | | | | | | | | | | | | | | * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): When removing a lib_LDFLAGS line, remove also the newline. Fix regex that matches lib_SOMETHING. Add a newline after each '## begin gnulib module' line. Don't emit 'endif' lines without corresponding 'if'. When emitting a '+=' augmentation, make sure it does not get emitted a second time. Don't emit a blank line when there is no AM_CPPFLAGS augmentation. Update after getLink() changed. In the value of DEFAULT_TEXT_DOMAIN, backslash-escape the double-quotes. Don't produce Windows CR-LFs on Windows. Simplify. (GLEmiter.tests_Makefile_am): When removing a lib_LDFLAGS line, remove also the newline. Fix regex that matches lib_SOMETHING. Don't remove a blank line before EXTRA_DIST. Add a newline after each '## begin gnulib module' line. Set uses_subdirs also when there is a .c file in a subdir of tests/. When emitting a '+=' augmentation, make sure it does not get emitted a second time. Don't produce Windows CR-LFs on Windows. Simplify. * pygnulib/GLImport.py (GLImport.execute): Update after getLink() changed.
* gnulib-tool.py: Fixes for conditional dependencies.Bruno Haible2022-08-093-36/+44
| | | | | | | | * pygnulib/GLModuleSystem.py (GLModule.shell_id_chars): New constant. (GLModule.getShellFunc): Don't use md5 just because of an '_' character. (GLModule.getShellVar): Likewise. (GLModule.getConditionalName): Include a newline in the md5 input. * pygnulib/constants.py (ALPHANUMERIC): Remove constant.
* gnulib-tool.py: Refactor.Bruno Haible2022-08-092-10/+17
| | | | | * pygnulib/GLModuleSystem.py (GLModule.getLicense): Separate the warning logic from the result logic.
* largefile, year2038: simplify if Autoconf 2.72Paul Eggert2022-08-093-2/+24
| | | | | | | | * m4/largefile.m4 (gl_SET_LARGEFILE_SOURCE) (_AC_SYS_LARGEFILE_MACRO_VALUE): * m4/year2038.m4 (gl_YEAR2038_EARLY, gl_YEAR2038, gl_YEAR2038_BODY): Adjust to Autoconf 2.72, which should contain the Gnulib patches in this area and so should not need to be overridden.
* gnulib-tool.py: Finish implementing option --extract-test-module.Bruno Haible2022-08-083-1/+11
| | | | * gnulib-tool.py (main): Accept option --extract-tests-module.
* gnulib-tool.py: Fix handling of nonexistent module names in --extract-*.Bruno Haible2022-08-082-69/+68
| | | | | * gnulib-tool.py (main): To test whether a module exists, just call GLModuleSystem.find and test its return value.
* gnulib-tool.py: Fix --extract-dependencies result.Bruno Haible2022-08-084-33/+75
| | | | | | | | | | | | * pygnulib/GLModuleSystem.py (GLModule.getDependencies): Return a snippet, not a list. Implement dependency of ${module}-tests on ${module}. (GLModule.getDependenciesWithoutConditions, GLModule.getDependenciesWithConditions): New methods. (GLModuleTable.transitive_closure): Call getDependenciesWithConditions. * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Call getDependenciesWithoutConditions. * gnulib-tool.py (main) [--extract-dependencies]: Update.
* gnulib-tool.py: Rename a method.Bruno Haible2022-08-074-5/+11
| | | | | | | * pygnulib/GLModuleSystem.py (GLModule.getAutoconfEarlySnippet): Renamed from GLModule.getAutoconfSnippet_Early. * pygnulib/GLImport.py: Update. * pygnulib/GLTestDir.py: Likewise.
* gnulib-tool.py: Fix section extraction from module descriptions.Bruno Haible2022-08-075-302/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code with self.content.split(section)[-1] was broken because it recognizes an indented section label. Similar code with ('\n' + self.content).split('\n' + section)[-1] would still be broken because it recognizes an indented section label in the first line of the file. The code with section_label_regex was broken because sometimes it returns the second-to-last section with the given label, not the last one. Also, whitespace after the colon was not ignored. * pygnulib/GLModuleSystem.py (GLModule.__init__): Dissect the module description's contents immediately, once only, in a reliable way. (GLModule.getDescription, GLModule.getComment): Simplify. (GLModule.getStatus): Simplify. Return a string. (GLModule.getStatuses): New function. Return a list. (GLModule.getNotice, GLModule.getApplicability, GLModule.getFiles, GLModule.getDependencies, GLModules.getAutoconfSnippet_Early, GLModules.getAutoconfSnippet, GLModule.getAutomakeSnippet_Conditional, GLModule.getInclude, GLModule.getLink, GLModule.getLicense_Raw): Simplify. (GLModule.getLicense): Remove whitespace after calling getLicense_Raw. (GLModule.getMaintainer): Simplify. (GLModuleTable.transitive_closure): Call getStatuses() instead of getStatus(). * pygnulib/GLEmiter.py: Likewise. * gnulib-tool.py (main): For --extract-description, --extract-comment, --extract-status, --extract-notice, --extract-autoconf-snippet, --extract-automake-snippet, --extract-include-directive, --extract-link-directive, --extract-maintainer, don't add an extra newline after the snippet.
* gnulib-tool.py: Improve field naming.Bruno Haible2022-08-072-20/+22
| | | | | * pygnulib/GLModuleSystem.py (GLModule): Rename field 'module' to 'path'. Fix a typo in a TypeError message.
* gnulib-tool.py: Simplify.Bruno Haible2022-08-072-12/+5
| | | | | * pygnulib/GLModuleSystem.py (GLModule): Convert Windows newlines right after reading the module description, not in every accessor.
* gnulib-tool.py: Reduce code duplication.Bruno Haible2022-08-072-61/+27
| | | | | * pygnulib/GLModuleSystem.py (GLModule): Declare two regexes are class variables.
* gnulib-tool.py: Implement option --find.Bruno Haible2022-08-074-34/+97
| | | | | | | | * pygnulib/GLModuleSystem.py (GLModuleSystem.file_is_module): New method. (GLModuleSystem.list): Filter the listing in memory; don't use a 'sed' subprocess. * gnulib-tool.py (main): Handle mode 'find'.
* gnulib-tool: Fix option --find in combination with option --local-dir.Bruno Haible2022-08-072-1/+12
| | | | | | * gnulib-tool (func_prefixed_modules_in_dir): New function. (find): Use it, and filter the directory names away after the 'grep' pass.
* gnulib-tool.py: Fix some regexes.Bruno Haible2022-08-073-3/+8
| | | | | | * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Use an equivalent regex as gnulib-tool. * pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.
* gnulib-tool.py: Fix some regex uses.Bruno Haible2022-08-073-2/+7
| | | | | | * pygnulib/GLModuleSystem.py (GLModuleTable.transitive_closure): Match the regex against all lines of the snippet, not only the first line. * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippet): Likewise.
* gnulib-tool.py: Make regex uses more straightforward.Bruno Haible2022-08-073-2/+8
| | | | | | | * pygnulib/constants.py: Don't use the "minimal matching" *? construct when it makes no difference (because we're matching a single line only and flag re.M is not specified). * pygnulib/GLModuleSystem.py: Likewise.
* gnulib-tool.py: Make regex uses more straightforward.Bruno Haible2022-08-075-24/+33
| | | | | | | | | | * pygnulib/GLModuleSystem.py: Don't use flag re.S on regular expressions that are meant to match a single line only, and remove the use of the "minimal matching" *? construct whose only purpose was to neutralize the re.S flag. * pygnulib/GLEmiter.py: Likewise. * pygnulib/GLImport.py: Likewise. * pygnulib/GLTestDir.py: Likewise.
* gnulib-tool.py: Make regex uses more straightforward.Bruno Haible2022-08-073-5/+12
| | | | | | * pygnulib/GLEmiter.py: Don't use flag re.S on regular expressions on regular expressions with no '.'. * pygnulib/GLImport.py: Likewise.
* gnulib-tool: In the VC files messages, omit the destination directory.Bruno Haible2022-08-063-11/+18
| | | | | | | | | This makes these messages consistent with the other "Copying ..." and "Creating ..." messages. * gnulib-tool (func_import): Omit $destdir/ from the "Updating"/ "Creating" messages regarding .gitignore files. * pygnulib/GLImport.py (GLImport._update_ignorelist_): Likewise.
* gnulib-tool.py: Fix output in --dry-run mode.Bruno Haible2022-08-062-1/+5
| | | | | * pygnulib/GLImport.py (GLImport._update_ignorelist_): In dry-run mode, say "Update", not "Updating".
* gnulib-tool.py: Finish implementing options --vc-files, --no-vc-files.Bruno Haible2022-08-065-36/+53
| | | | | | | | | * gnulib-tool.py (main): Accept options --vc-files, --no-vc-files. * pygnulib/GLImport.py (GLImport.__init__): Correct parsing of gl_VC_FILES directive. (GLImport.gnulib_cache): Don't treat the value False like None. (GLImport.execute): Skip the .gitignore file manipulations if vc_files is False.
* gnulib-tool.py: Finish implementing option --witness-c-macro.Bruno Haible2022-08-064-11/+18
| | | | | | * gnulib-tool.py (main): Accept option --witness-c-macro. * pygnulib/GLConfig.py (GLConfig.__init__): Remove wrong type check of witness_c_macro argument.
* gnulib-tool.py: Don't initialize local variables too early.Bruno Haible2022-08-062-26/+12
| | | | | | * gnulib-tool.py (main): Initialize each local variable in one place. I prefer to have pylint tell me about uninitialized variables than to get the value None at runtime.
* gnulib-tool.py: Finish implementing option --po-domain.Bruno Haible2022-08-065-8/+35
| | | | | | | | | * gnulib-tool.py (main): Accept option --po-domain. * pygnulib/GLEmiter.py (GLEmiter.po_POTFILES_in): Fix variable reference. * pygnulib/GLImport.py (GLImport.execute): Don't delete Makefile.in.in from the gnulib directory. Don't require a shell when invoking wget. After invoking wget, restore the current directory.
* gnulib-tool.py: Finish implementing option --macro-prefix.Bruno Haible2022-08-063-2/+13
| | | | * gnulib-tool.py (main): Accept option --macro-prefix.
* gnulib-tool.py: Refactor --makefile-name option.Bruno Haible2022-08-062-4/+10
| | | | | * gnulib-tool.py (main): Handle option --makefile-name like all other string-valued options.
* gnulib-tool.py: Implement option --no-libtool.Bruno Haible2022-08-063-4/+10
| | | | * gnulib-tool.py (main): Accept option --no-libtool.
* gnulib-tool.py: Remove redundant type checks.Bruno Haible2022-08-052-53/+24
| | | | | | | * pygnulib/GLConfig.py (GLConfig.__init__): Remove redundant type checks, left over from 2022-08-04. (GLConfig.getIncludeGuardPrefix): Improve comment. (GLConfig.resetMacroPrefix): Optimize.
* gnulib-tool.py: Refactor --makefile-name option.Bruno Haible2022-08-057-57/+64
| | | | | | | | | * gnulib-tool.py (main): Rename variable 'makefile' to 'makefile_name'. * pygnulib/GLConfig.py: Rename attribute 'makefile' to 'makefile_name'. * pygnulib/GLMakefileTable.py: Update. * pygnulib/GLEmiter.py: Likewise. * pygnulib/GLImport.py: Likewise. * pygnulib/GLFileSystem.py (GLFileAssistant): Remove unused assignment.
* gnulib-tool.py: Fix link_if_changed function.Bruno Haible2022-08-052-15/+34
| | | | | | | | * pygnulib/constants.py (joinpath): Fix comment. (as_link_value_at_dest): New function, extracted from link_relative. (link_relative): Use it. (link_if_changed): Really don't replace the symbolic link if it does not need to change.
* gnulib-tool.py: Fix 'Unused import' warnings.Bruno Haible2022-08-0510-35/+7
| | | | | * gnulib-tool.py: Remove unused imports. * pygnulib/*.py: Likewise.