]> Savannah Git Hosting - gnulib.git/log
gnulib.git
22 months agocorrect my typo in ChangeLog; making it mirror the correct commit log
Jim Meyering [Sat, 10 Jun 2023 00:28:26 +0000 (17:28 -0700)]
correct my typo in ChangeLog; making it mirror the correct commit log

22 months agodoc: Document <stdatomic.h>.
Bruno Haible [Fri, 9 Jun 2023 19:59:29 +0000 (21:59 +0200)]
doc: Document <stdatomic.h>.

* doc/posix-headers/stdatomic.texi: New file.
* doc/gnulib.texi (Header File Substitutes): Include it.

22 months agomaint.mk: sc_prohibit_xalloc_without_use: also match alloc_die
Jim Meyering [Fri, 9 Jun 2023 17:15:30 +0000 (10:15 -0700)]
maint.mk: sc_prohibit_xalloc_without_use: also match alloc_die

* top/maint.mk (sc_prohibit_xalloc_without_use):
Adjust in-comment command's regexp so it also finds alloc_die,
whose declaration has a prefix of "_Noreturn" .
Also delete some now-obsolete commentary.
(_xa1): Regenerate the regexp using that command.
Reported by Pádraig Brady in
<https://lists.gnu.org/r/bug-gnulib/2023-06/msg00062.html>.

22 months agoCorrection of a spelling fix.
Bruno Haible [Fri, 9 Jun 2023 18:45:45 +0000 (20:45 +0200)]
Correction of a spelling fix.

* lib/argp.h: Change "passed into" to "passed to".

22 months agoxalloc-die: omit /*extern*/
Paul Eggert [Fri, 9 Jun 2023 18:13:19 +0000 (11:13 -0700)]
xalloc-die: omit /*extern*/

* lib/xalloc.h (xalloc_die): Omit leading "/*extern*/".
It complicates syntax checking; see:
https://lists.gnu.org/r/bug-gnulib/2023-06/msg00062.html
Plus, it’s inconsistent style: the other function declarations in
xalloc.h don’t use ‘extern’. (I’m not a fan of using ‘extern’ when
it’s just noise, as is the case here.)

22 months agojavaversion: Update comments.
Bruno Haible [Fri, 9 Jun 2023 15:08:14 +0000 (17:08 +0200)]
javaversion: Update comments.

* lib/javaversion.h (javaexec_version): Document the possible results up
to OpenJDK 20.

22 months agojavacomp: Remove support for 'jikes'.
Bruno Haible [Fri, 9 Jun 2023 14:11:23 +0000 (16:11 +0200)]
javacomp: Remove support for 'jikes'.

* lib/javacomp.c (compile_using_jikes, is_jikes_present): Remove
functions.
(compile_java_class): Remove jikes related code.

22 months agojavacomp-script: Remove support for 'jikes'.
Bruno Haible [Fri, 9 Jun 2023 14:08:18 +0000 (16:08 +0200)]
javacomp-script: Remove support for 'jikes'.

* build-aux/javacomp.sh.in: Don't test HAVE_JIKES.
* m4/javacomp.m4 (gt_JAVACOMP): Don't set HAVE_JIKES. Don't set
CONF_JAVAC to 'jikes'. Update comment.
(gt_JAVACOMP_DISABLED): Don't set HAVE_JIKES.

22 months agojavacomp: Remove support for 'gcj'.
Bruno Haible [Fri, 9 Jun 2023 13:45:25 +0000 (15:45 +0200)]
javacomp: Remove support for 'gcj'.

* lib/javacomp.h: Update comment.
* lib/javacomp.c (compile_using_gcj, is_envjavac_gcj, is_envjavac_gcj43,
is_envjavac_gcj43_usable, is_envjavac_oldgcj_14_14_usable,
is_envjavac_oldgcj_14_13_usable, is_gcj_present, is_gcj_43,
is_gcj43_usable, is_oldgcj_14_14_usable, is_oldgcj_14_13_usable): Remove
functions.
(is_envjavac_usable): Renamed from is_envjavac_nongcj_usable.
(compile_java_class): Remove gcj related code.

22 months agojavacomp-script: Remove support for 'gcj'.
Bruno Haible [Fri, 9 Jun 2023 13:29:01 +0000 (15:29 +0200)]
javacomp-script: Remove support for 'gcj'.

* build-aux/javacomp.sh.in: Don't test HAVE_GCJ_C.
* m4/javacomp.m4 (gt_JAVACOMP): Don't set HAVE_GCJ_C. Don't test whether
$JAVAC is gcj. Don't set CONF_JAVAC to 'gcj -C'. Update comment.
(gt_JAVACOMP_DISABLED): Don't set HAVE_GCJ_C.

22 months agojavaexec: Remove support for 'gij'.
Bruno Haible [Fri, 9 Jun 2023 13:17:53 +0000 (15:17 +0200)]
javaexec: Remove support for 'gij'.

* lib/javaexec.c (execute_java_class): Don't test for gij.

22 months agojavaexec-script: Remove support for 'gij'.
Bruno Haible [Fri, 9 Jun 2023 13:14:52 +0000 (15:14 +0200)]
javaexec-script: Remove support for 'gij'.

* build-aux/javaexec.sh.in: Don't test HAVE_GIJ.
* m4/javaexec.m4 (gt_JAVAEXEC): Don't set HAVE_GIJ. Don't set CONF_JAVA
to 'gij'.
* m4/javacomp.m4: Update comment.

22 months agojavaexec: Remove support for 'jview'.
Bruno Haible [Fri, 9 Jun 2023 12:57:07 +0000 (14:57 +0200)]
javaexec: Remove support for 'jview'.

* lib/javaexec.c (execute_java_class): Don't test for jview.

22 months agojavaexec-script: Remove support for 'jview'.
Bruno Haible [Fri, 9 Jun 2023 12:56:49 +0000 (14:56 +0200)]
javaexec-script: Remove support for 'jview'.

* build-aux/javaexec.sh.in: Don't test HAVE_JVIEW.
* m4/javaexec.m4 (gt_JAVAEXEC): Don't set HAVE_JVIEW. Don't set
CONF_JAVA to 'jview'.
(gt_JAVAEXEC_DISABLED): Don't set HAVE_JVIEW.
* m4/javacomp.m4: Update comment.

22 months agoautoupdate
Paul Eggert [Fri, 9 Jun 2023 03:41:46 +0000 (20:41 -0700)]
autoupdate

22 months agoSpelling fixes
Paul Eggert [Thu, 8 Jun 2023 21:53:51 +0000 (14:53 -0700)]
Spelling fixes

Most of these were reported by Josh Soref <jsoref@gmail.com> in:
https://lists.gnu.org/r/bug-gnulib/2023-06/msg00057.html
except that some are omitted because the original is OK (e.g.,
"obsolescent"), and some are omitted because they are upstream
files and I've fixed them upstream or have filed bug reports,
and I made a few nearby corrections to grammar.

22 months agomaint.mk: regenerate regex to reflect new functions in xalloc.h
Jim Meyering [Wed, 7 Jun 2023 03:49:22 +0000 (20:49 -0700)]
maint.mk: regenerate regex to reflect new functions in xalloc.h

* top/maint.mk (sc_prohibit_xalloc_without_use) [_xa1]:
Regenerate using the command listed in the comment.

22 months ago* Changelog: Fix spelling typo.
Paul Eggert [Wed, 7 Jun 2023 02:50:19 +0000 (19:50 -0700)]
* Changelog: Fix spelling typo.

22 months agopropername: pacify po_check
Paul Eggert [Wed, 7 Jun 2023 01:42:56 +0000 (18:42 -0700)]
propername: pacify po_check

Problem reported by Bruno Haible <https://bugs.gnu.org/63933>.
* lib/propername.h: Change comment.

22 months agoPut "/" at end of .gitignore directory names
Paul Eggert [Tue, 6 Jun 2023 21:23:39 +0000 (14:23 -0700)]
Put "/" at end of .gitignore directory names

* build-aux/bootstrap: Regenerate.
* top/bootstrap-funclib.sh (symlink_to_dir, autogen):
Put slashes after .gitignore entries that name directories.

22 months agomaintainer-makefile: Enforce the GNU Coding Standards in the README.
Jose E. Marchesi [Tue, 6 Jun 2023 17:35:35 +0000 (19:35 +0200)]
maintainer-makefile: Enforce the GNU Coding Standards in the README.

* top/maint.mk (sc_readme_link_install): New rule.
(sc_readme_link_copying): Likewise.

23 months agocopy-file-range: support building for older kernels
Paul Eggert [Tue, 6 Jun 2023 05:04:37 +0000 (22:04 -0700)]
copy-file-range: support building for older kernels

* m4/copy-file-range.m4 (gl_FUNC_COPY_FILE_RANGE):
Remove static check, to support the dubious practice of
building for platforms that predate the build platform.
On working kernels this adds an extra syscall the first time
that copy_file_range is used.  Problem reported for Gentoo by
Sam James <https://bugs.gnu.org/63850>.

23 months agomanywarnings: more nuance about optimization
Paul Eggert [Mon, 5 Jun 2023 20:16:22 +0000 (13:16 -0700)]
manywarnings: more nuance about optimization

* doc/manywarnings.texi (manywarnings): Suggest compiling with the
optimization flags commonly used, as opposed to -O2 and -O0
specificially.  -ggdb shouldn’t affect warnings so don’t mention it.

23 months agoposix_spawn-internal: Fix a warning (regression 2022-11-20).
Bruno Haible [Mon, 5 Jun 2023 13:45:25 +0000 (15:45 +0200)]
posix_spawn-internal: Fix a warning (regression 2022-11-20).

* lib/spawni.c: Don't use this particular #pragma for gcc < 4.2.

23 months agofile-has-acl: Fix compilation error on Slackware 13 (regr. 2023-05-12).
Bruno Haible [Mon, 5 Jun 2023 13:13:53 +0000 (15:13 +0200)]
file-has-acl: Fix compilation error on Slackware 13 (regr. 2023-05-12).

* lib/file-has-acl.c (XATTR_NAME_POSIX_ACL_ACCESS,
XATTR_NAME_POSIX_ACL_DEFAULT): Add fallback definitions.

23 months agoFix bugs on mingw when module dirfd is in use (regression 2023-04-26).
Bruno Haible [Mon, 5 Jun 2023 09:15:37 +0000 (11:15 +0200)]
Fix bugs on mingw when module dirfd is in use (regression 2023-04-26).

* lib/getcwd.c: When GNULIB_defined_DIR, revert to the system's
definitions of opendir, closedir, readdir, rewinddir.
* lib/mountlist.c: When GNULIB_defined_DIR, revert to the system's
definitions of opendir, closedir, readdir.
* lib/scandir.c: Likewise.
* lib/glob.c: Fix comment. When GNULIB_defined_DIR, don't undefine
opendir, closedir.

23 months agomanywarnings: Overhaul documentation.
Bruno Haible [Sun, 4 Jun 2023 22:16:40 +0000 (00:16 +0200)]
manywarnings: Overhaul documentation.

* doc/manywarnings.texi: In the example, put all unwanted warning
options into 'nw', and use a second gl_MANYWARN_COMPLEMENT invocation to
sort out how these options need to get added to WARN_FLAGS.
Describe the first-time use in more detail: Recommend a new GCC.
Recommend to test builds with -O2 and with -O0. Suggest to sort the
warning by warning option. Add reference to the GCC pragma's
documentation.

23 months agoerror: Fix support for library namespacing (regression 2023-05-27).
Bruno Haible [Sun, 4 Jun 2023 17:27:48 +0000 (19:27 +0200)]
error: Fix support for library namespacing (regression 2023-05-27).

* lib/error.in.h (error): If error is defined as a macro, define a
static inline function _gl_inline_error that invokes it, and let the
new error macro invoke that function.
(error_at_line): If error_at_line is defined as a macro, define a static
inline function _gl_inline_error_at_line that invokes it, and let the
new error_at_line macro invoke that function.

23 months agoterminfo, termcap: Fix "discards 'const' qualifier" warnings.
Bruno Haible [Sun, 4 Jun 2023 14:41:47 +0000 (16:41 +0200)]
terminfo, termcap: Fix "discards 'const' qualifier" warnings.

* lib/tparm.c (tparm): Change type of 'fmt'. New local variable 'fmtp'.

23 months agouniname/uniname: Add comments.
Bruno Haible [Sun, 4 Jun 2023 12:08:24 +0000 (14:08 +0200)]
uniname/uniname: Add comments.

* modules/uniname/uniname (Makefile.am): Explain how to work around a
GCC bug.

23 months agouniname/uniname: Fix -Wformat-signedness warning.
Bruno Haible [Sun, 4 Jun 2023 08:50:29 +0000 (10:50 +0200)]
uniname/uniname: Fix -Wformat-signedness warning.

* lib/uniname/uniname.c (unicode_character_name): Use %u instead of %d
in format string.

23 months agouniname/uniname: Improve comments.
Bruno Haible [Sun, 4 Jun 2023 08:45:00 +0000 (10:45 +0200)]
uniname/uniname: Improve comments.

* lib/uniname/uniname.c (unicode_character_name): Fix comments.

23 months agoclasspath, csharpexec: Avoid "candidate for attribute 'malloc'" warning.
Bruno Haible [Sat, 3 Jun 2023 11:07:31 +0000 (13:07 +0200)]
classpath, csharpexec: Avoid "candidate for attribute 'malloc'" warning.

* lib/classpath.h (set_classpath): Mark with attribute 'malloc'.

23 months agopropername-lite: Improve documentation.
Bruno Haible [Sat, 3 Jun 2023 10:31:21 +0000 (12:31 +0200)]
propername-lite: Improve documentation.

* lib/propername.h: Describe functional differences between
proper_name_lite and proper_name_utf8.

23 months agognulib-tool: Keep in sync with last change to gnulib-tool.py.
Bruno Haible [Sat, 3 Jun 2023 10:26:08 +0000 (12:26 +0200)]
gnulib-tool: Keep in sync with last change to gnulib-tool.py.

* gnulib-tool (func_emit_po_Makevars): Treat proper_name_lite like
proper_name_utf8.

23 months agoerror: Improve comments.
Bruno Haible [Sat, 3 Jun 2023 09:59:59 +0000 (11:59 +0200)]
error: Improve comments.

* lib/error.in.h (__gl_error_call): Add more comments.

23 months agoerror: do not evaluate status twice
Paul Eggert [Sat, 3 Jun 2023 05:30:52 +0000 (22:30 -0700)]
error: do not evaluate status twice

Do this in a different way, so that the status is evaluated
once even when not optimizing and when using GCC.
* lib/error.in.h (__gl_error_call1) [__GNUC__]: New macro.
(__gl_error_call) [__GNUC__]: Use it.

23 months agowarnings: Add ability to inhibit all warnings.
Bruno Haible [Fri, 2 Jun 2023 21:41:47 +0000 (23:41 +0200)]
warnings: Add ability to inhibit all warnings.

* m4/warnings.m4 (gl_CC_INHIBIT_WARNINGS, gl_CXX_INHIBIT_WARNINGS): New
macros, based on gl_CC_ALLOW_WARNINGS and gl_CXX_ALLOW_WARNINGS in
m4/gnulib-common.m4.

23 months agopropername-lite: new module
Paul Eggert [Fri, 2 Jun 2023 21:02:53 +0000 (14:02 -0700)]
propername-lite: new module

propername_lite acts like propername_utf8 but needs less
infrastructure, e.g., it does not worry about memory allocation.
* MODULES.html.sh (func_all_modules): Mention it.
* lib/propername.h (proper_name_lite): New decl.
* lib/propername-lite.c, modules/propername-lite: New files.
* pygnulib/GLEmiter.py (GLEmiter.po_Makevars):
Treat proper_name_lite like proper_name_utf8.

23 months agoopenmp-init: Silence "no previous prototype for 'openmp_init'" warning.
Bruno Haible [Fri, 2 Jun 2023 18:11:53 +0000 (20:11 +0200)]
openmp-init: Silence "no previous prototype for 'openmp_init'" warning.

* lib/omp.in.h: Test _OPENMP.
* lib/omp-init.c: Include <omp.h> always.
* modules/openmp-init (Include): Allow <omp.h> to be included always.

23 months agoterm-style-control: Silence -Wshadow warning.
Bruno Haible [Fri, 2 Jun 2023 18:11:49 +0000 (20:11 +0200)]
term-style-control: Silence -Wshadow warning.

* lib/term-style-control.c (continuing_signal_handler): Rename
parameter.

23 months agopipe-filter-gi, pipe-filter-ii: Silence -Wunused-macro warning.
Bruno Haible [Fri, 2 Jun 2023 18:11:45 +0000 (20:11 +0200)]
pipe-filter-gi, pipe-filter-ii: Silence -Wunused-macro warning.

* lib/pipe-filter-aux.c: Remove many unnecessary includes.
(_): Remove macro.

23 months agojavacomp: Silence -Wanalyzer-possible-null-argument warning.
Bruno Haible [Fri, 2 Jun 2023 18:11:57 +0000 (20:11 +0200)]
javacomp: Silence -Wanalyzer-possible-null-argument warning.

* lib/javacomp.c: Include verify.h.
(is_envjavac_gcj43_usable, is_envjavac_oldgcj_14_13_usable,
is_envjavac_nongcj_usable, compile_java_class): Assert that the
xasprintf results are non-NULL. This is possible since all involved
format strings are valid and don't use %ls, and all argument strings
are small compared to INT_MAX.
* modules/javacomp (Depends-on): Add verify.

23 months agostriconveha: Don't crash if malloc() returns NULL.
Bruno Haible [Fri, 2 Jun 2023 18:11:41 +0000 (20:11 +0200)]
striconveha: Don't crash if malloc() returns NULL.

* lib/striconveha.c (mem_iconveha, str_iconveha): Check malloca() return
value.

23 months agosetenv: Don't crash if malloc() returns NULL.
Bruno Haible [Fri, 2 Jun 2023 18:11:36 +0000 (20:11 +0200)]
setenv: Don't crash if malloc() returns NULL.

* lib/setenv.c (rpl_setenv): Check malloca() return value.

23 months agoerror: Avoid implicit-fallthrough warnings with -O0 (regr. 2023-05-30).
Bruno Haible [Fri, 2 Jun 2023 18:02:45 +0000 (20:02 +0200)]
error: Avoid implicit-fallthrough warnings with -O0 (regr. 2023-05-30).

* lib/error.in.h (__gl_error_call): Parenthesize status. When not
optimizing, expand to code without compound statements.

23 months agogetprogname: Add support for ASCII-compatible environments in z/OS.
Bruno Haible [Thu, 1 Jun 2023 14:18:02 +0000 (16:18 +0200)]
getprogname: Add support for ASCII-compatible environments in z/OS.

Reported by Mike Fulton <mikefultonpersonal@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-05/msg00198.html>.

* lib/getprogname.c (getprogname): On z/OS, when compiling for an
ASCII-compatible environment, convert the result from EBCDIC to ASCII.

23 months agognulib-tool.py: Fix a format string mistake.
Mitch Capper [Thu, 1 Jun 2023 13:50:56 +0000 (15:50 +0200)]
gnulib-tool.py: Fix a format string mistake.

* pygnulib/GLImport.py (GLImport.execute): Fix a typo in a format
string.

Copyright-paperwork-exempt: Yes

23 months agoAdd info for maintainers and contributors.
Bruno Haible [Thu, 1 Jun 2023 13:11:35 +0000 (15:11 +0200)]
Add info for maintainers and contributors.

* HACKING: New file.

23 months agoreadline: fix memory leak in replacement readline.
Nick Bowler [Wed, 31 May 2023 01:26:19 +0000 (21:26 -0400)]
readline: fix memory leak in replacement readline.

* lib/readline.c (readline): Free memory after getline failure.
Copyright-paperwork-exempt: true

23 months agoerror: fix typo in previous patch
Paul Eggert [Tue, 30 May 2023 22:12:43 +0000 (15:12 -0700)]
error: fix typo in previous patch

* lib/error.in.h (error): Fix __VA_ARGS__ typo noted by
Bruno Haible.

23 months agoerror: don’t call ‘exit’
Paul Eggert [Tue, 30 May 2023 21:38:41 +0000 (14:38 -0700)]
error: don’t call ‘exit’

Let the underlying functions call ‘exit’, instead of having the
Gnulib replacement macros do it.  Use ‘unreachable’ to tell the
compiler that those functions exit when the status is nonzero.
This saves a function call.
* lib/error.in.h: Include stddef.h, not stdlib.h.
(__gl_error_call): Rely on the function to exit, using
‘unreachable’ to tell the compiler that the function does not return.
* modules/error (Depends-on): Add stddef.

23 months agoerror: don’t evaluate status arg twice
Paul Eggert [Tue, 30 May 2023 19:49:20 +0000 (12:49 -0700)]
error: don’t evaluate status arg twice

This avoids potential issues if the first argument has a side effect.
* lib/error.in.h (__gl_error_call): New macro, which evaluates its
status arg only once, by using a statement expression if GNU C -
the only platform we need to worry about pacifying - and by simply
calling ‘error’ otherwise.
(error, error_at_line): Use it.

23 months agowarnings, manywarnings: Assume autoconf >= 2.64.
Bruno Haible [Sun, 28 May 2023 17:00:34 +0000 (19:00 +0200)]
warnings, manywarnings: Assume autoconf >= 2.64.

* m4/warnings.m4 (gl_AS_VAR_APPEND): Remove macro.
(gl_COMPILER_OPTION_IF, gl_WARN_ADD): Use AS_VAR_APPEND instead of
gl_AS_VAR_APPEND.
* m4/manywarnings.m4: Likewise.

23 months agofile-has-acl: avoid warning from bleeding-edge GCC
Jim Meyering [Sun, 28 May 2023 16:41:08 +0000 (09:41 -0700)]
file-has-acl: avoid warning from bleeding-edge GCC

* lib/file-has-acl.c: Include attribute.h.
(have_xattr): Declare with ATTRIBUTE_PURE,
to avoid new warning from GCC14-to-be.
* modules/file-has-acl (Depends-on): Add attribute.
Spotted while building coreutils with this:
gcc version 14.0.0 20230526 (experimental)

23 months agoerror: Avoid -Wint-in-bool-context warning.
Bruno Haible [Sun, 28 May 2023 13:18:06 +0000 (15:18 +0200)]
error: Avoid -Wint-in-bool-context warning.

Reported by Pádraig Brady in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-05/msg00178.html>.

* lib/error.in.h (error, error_at_line): Use 'status != 0', since status
is expected to be an int, not a bool value.

23 months agoerror: Support the compiler's control flow analysis better.
Bruno Haible [Sat, 27 May 2023 20:39:59 +0000 (22:39 +0200)]
error: Support the compiler's control flow analysis better.

* lib/error.in.h: Remove @PRAGMA_SYSTEM_HEADER@. Include <stdlib.h>.
(error): Define as a macro that explicitly invokes exit().
(error_at_line): Likewise.
* lib/error.c (_GL_NO_INLINE_ERROR): Define before including error.h.
* modules/error-h (configure.ac): Don't invoke gl_CONDITIONAL_HEADER.
(Makefile.am): Generate error.h always. Don't substitute
PRAGMA_SYSTEM_HEADER.
* m4/error_h.m4 (gl_ERROR_H): Set COMPILE_ERROR_C instead of
GL_GENERATE_ERROR_H.
* modules/error (configure.ac, Depends-on): Test COMPILE_ERROR_C instead
of GL_GENERATE_ERROR_H.
* lib/copy-file.c: Revert the last change.

23 months agoflexmember: Make it easier to use.
Bruno Haible [Fri, 26 May 2023 22:18:57 +0000 (00:18 +0200)]
flexmember: Make it easier to use.

* lib/flexmember.h (FLEXNSIZEOF): New macro.
* lib/hamt.c (alloc_bucket, alloc_subtrie): Fix FLEXSIZEOF invocation.
Use FLEXNSIZEOF instead of FLEXSIZEOF.
* lib/ssfmalloc.h (init_small_block_page_pool): Use FLEXNSIZEOF instead
of FLEXSIZEOF.

23 months agodiffseq: Silence another gcc warning.
Bruno Haible [Fri, 26 May 2023 19:37:42 +0000 (21:37 +0200)]
diffseq: Silence another gcc warning.

* lib/diffseq.h (compareseq): Move into the scope of the '#pragma GCC
diagnostic'.

23 months agocopy-file: Silence gcc warnings.
Bruno Haible [Fri, 26 May 2023 17:27:09 +0000 (19:27 +0200)]
copy-file: Silence gcc warnings.

* lib/copy-file.c: Add #pragma GCC diagnostic.

23 months agodiffseq: Silence gcc warning.
Bruno Haible [Fri, 26 May 2023 12:39:01 +0000 (14:39 +0200)]
diffseq: Silence gcc warning.

* lib/diffseq.h: Add #pragma GCC diagnostic.

23 months agomanywarnings: speed up nomfi test
Paul Eggert [Wed, 24 May 2023 17:10:18 +0000 (10:10 -0700)]
manywarnings: speed up nomfi test

* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Simplify and speed up
on current platforms, by seeing first whether
-Wno-missing-field-initializers is needed (it isn’t), so that
later we don’t need to determine whether it’s supported.

23 months agoSimplify -Wno-missing-field-initializers checking
Paul Eggert [Wed, 24 May 2023 16:23:01 +0000 (09:23 -0700)]
Simplify -Wno-missing-field-initializers checking

* m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): Don’t worry about
-Wmissing-field-initializers, as this is no longer needed now that
gl_MANYWARN_ALL_GCC is fixed.

23 months agomanywarnings: port better to GCC 11.2 and earlier
Paul Eggert [Wed, 24 May 2023 16:20:48 +0000 (09:20 -0700)]
manywarnings: port better to GCC 11.2 and earlier

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-diffutils/2023-05/msg00015.html
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC):
Also test for GCC bug 82283
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82283>.

23 months agoasyncsafe-spin, simple-atomic: Don't use -mcpu-v9 on NetBSD/sparc.
Bruno Haible [Wed, 24 May 2023 08:17:30 +0000 (10:17 +0200)]
asyncsafe-spin, simple-atomic: Don't use -mcpu-v9 on NetBSD/sparc.

Reported by Brandon Applegate in
<https://lists.gnu.org/archive/html/bug-gettext/2023-05/msg00042.html>.

* lib/asyncsafe-spin.c: Limit the SPARC workaround to Solaris.
* lib/simple-atomic.c: Likewise.
* m4/sparcv8+.m4 (gl_SPARC_V8PLUS): Likewise.

23 months agonstrftime: wmemmove → __wmemmove in glibc part
Paul Eggert [Tue, 23 May 2023 19:56:40 +0000 (12:56 -0700)]
nstrftime: wmemmove → __wmemmove in glibc part

https://sourceware.org/pipermail/libc-alpha/2023-May/148435.html
* lib/nstrftime.c (__strftime_internal) [COMPILE_WIDE]:
Use __wmemmove, not wmemmove, to keep in better sync with draft glibc.

23 months agogit-merge-changelog: Code style changes.
Bruno Haible [Mon, 22 May 2023 12:32:42 +0000 (14:32 +0200)]
git-merge-changelog: Code style changes.

* lib/git-merge-changelog.c: Don't make side effects to variables
inside parenthesized expressions. Write (size_t)(-1), for consistency
with gl_list.h.
(compute_mapping): Rename variable in2 to jrev.

23 months agostrtol: match 'configure' to 'make check'
Paul Eggert [Mon, 22 May 2023 01:25:45 +0000 (18:25 -0700)]
strtol: match 'configure' to 'make check'

Inferred from report by Tomasz Kłoczko <https://bugs.gnu.org/63632>.
* m4/strtol.m4 (gl_FUNC_STRTOL):
* m4/strtoll.m4 (gl_FUNC_STRTOLL):
Also test "0b", since the test cases check it.

23 months agogit-merge-changelog: port to size_t padding
Paul Eggert [Sun, 21 May 2023 20:45:12 +0000 (13:45 -0700)]
git-merge-changelog: port to size_t padding

* lib/git-merge-changelog (entry_hashcode):
As a nicety, Prefer SIZE_WIDTH to computing it ourselves.

23 months agogit-merge-changelog: prefer idx_t
Paul Eggert [Sun, 21 May 2023 20:25:25 +0000 (13:25 -0700)]
git-merge-changelog: prefer idx_t

* lib/git-merge-changelog.c: Include idx.h.
(struct entry, entry_create, entry_hashcode)
(struct changelog_file, read_changelog_file)
(entries_mapping_get, entries_mapping_reverse_get)
(compute_mapping, struct edit, struct differences)
(compute_differences, find_paragraph_end)
(try_split_merged_entry, struct conflict, conflict_write, main):
Prefer idx_t to ptrdiff_t and size_t when the value is a
nonnegative index or size.  Change a few for-loops so that
the index never goes negative.
* modules/git-merge-changelog (Depends-on): Add idx.

23 months agogit-merge-changelog: ssize_t → ptrdiff_t
Paul Eggert [Sun, 21 May 2023 20:05:30 +0000 (13:05 -0700)]
git-merge-changelog: ssize_t → ptrdiff_t

Prefer ptrdiff_t to ssize_t, as per
<https://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00019.html>.
* lib/git-merge-changelog.c (struct entries_mapping)
(entries_mapping_get, entries_mapping_reverse_get)
(compute_mapping, struct edit, struct differences, OFFSET)
(OFFSET_MAX, EXTRA_CONTEXT_FIELDS, compute_differences, main):
Use ptrdiff_t, not ssize_t.
* modules/git-merge-changelog (Depends-on): Add stdint for PTRDIFF_MAX.

23 months agogit-merge-changelog: port to ssize_t padding
Paul Eggert [Sun, 21 May 2023 18:38:50 +0000 (11:38 -0700)]
git-merge-changelog: port to ssize_t padding

* lib/git-merge-changelog.c (OFFSET_MAX): New macro, as a nicety.

23 months agolimits-h tests: Check the value of SSIZE_MAX.
Bruno Haible [Sun, 21 May 2023 12:42:27 +0000 (14:42 +0200)]
limits-h tests: Check the value of SSIZE_MAX.

* tests/test-limits-h.c (limits12): New variable.
Include <sys/types.h> and check the value of SSIZE_MAX.
* modules/limits-h-tests (Depends-on): Add sys_types.

23 months agossize_t: Fix replacement on 64-bit Windows.
Bruno Haible [Sun, 21 May 2023 12:40:04 +0000 (14:40 +0200)]
ssize_t: Fix replacement on 64-bit Windows.

* m4/ssize_t.m4 (gt_TYPE_SSIZE_T): Use prefix 'gl_' instead of 'gt_'.
Define ssize_t to 'long long' or 'long', depending on the width of
'size_t'.

23 months agoregex: use limits-h SSIZE_MAX
Paul Eggert [Sat, 20 May 2023 22:24:05 +0000 (15:24 -0700)]
regex: use limits-h SSIZE_MAX

23 months agogetndelim2: use limits-h SSIZE_MAX
Paul Eggert [Sat, 20 May 2023 22:23:16 +0000 (15:23 -0700)]
getndelim2: use limits-h SSIZE_MAX

23 months agogetdelim: use limits-h SSIZE_MAX
Paul Eggert [Sat, 20 May 2023 22:22:32 +0000 (15:22 -0700)]
getdelim: use limits-h SSIZE_MAX

23 months agocareadlinkat: use limits-h SSIZE_MAX
Paul Eggert [Sat, 20 May 2023 22:21:40 +0000 (15:21 -0700)]
careadlinkat: use limits-h SSIZE_MAX

This also adds a dependency of relocatable-prog-wrapper on
limits-h, since relocatable-prog-wrapper also contains
lib/careadlinkat.c.

23 months agoareadlinkat-with-size: use limits-h SSIZE_MAX
Paul Eggert [Sat, 20 May 2023 22:20:14 +0000 (15:20 -0700)]
areadlinkat-with-size: use limits-h SSIZE_MAX

23 months agolimits-h: other modules can rely on SSIZE_MAX
Paul Eggert [Sat, 20 May 2023 20:48:00 +0000 (13:48 -0700)]
limits-h: other modules can rely on SSIZE_MAX

* lib/areadlink-with-size.c (SSIZE_MAX):
Do not define.
* modules/areadlink-with-size (Depends-on):
Add limits-h.

23 months agolimits-h: define SSIZE_MAX
Paul Eggert [Sat, 20 May 2023 20:46:19 +0000 (13:46 -0700)]
limits-h: define SSIZE_MAX

* doc/posix-headers/limits.texi (limits.h): Document this.
* lib/limits.in.h (SSIZE_MAX): Define if not already defined.
* m4/limits-h.m4 (gl_LIMITS_H): Also generate limits.h
if <limits.h> does not define SSIZE_MAX.

23 months agodiffseq: backward compatibility for OFFSET_MAX
Paul Eggert [Sat, 20 May 2023 19:11:54 +0000 (12:11 -0700)]
diffseq: backward compatibility for OFFSET_MAX

* lib/diffseq.h (OFFSET_MAX): Define only if not already defined.

23 months agocareadlinkat: Silence gcc warning for GCC ≥ 12.
Bruno Haible [Fri, 19 May 2023 21:55:34 +0000 (23:55 +0200)]
careadlinkat: Silence gcc warning for GCC ≥ 12.

* lib/careadlinkat.c: For GCC 12 or newer, use
"#pragma GCC diagnostic ignored" to silence the warning.

23 months agomodechange: pacify gcc -Wsuggest-attribute=pure
Pádraig Brady [Fri, 19 May 2023 09:34:44 +0000 (10:34 +0100)]
modechange: pacify gcc -Wsuggest-attribute=pure

* lib/modechange.h (mode_adjust): Add _GL_ATTRIBUTE_PURE
suggested with GCC 12 with -flto.

23 months agodiffseq: don’t assume integers lack padding
Paul Eggert [Fri, 19 May 2023 15:57:29 +0000 (08:57 -0700)]
diffseq: don’t assume integers lack padding

* NEWS: Mention this.
* lib/diffseq.h (OFFSET_MAX): Don’t define;
this is now the user’s responsibility.
* lib/fstrcmp.c (OFFSET_MAX): Define to PTRDIFF_MAX.

23 months agogetndelim2: Silence gcc warning.
Bruno Haible [Thu, 18 May 2023 22:45:50 +0000 (00:45 +0200)]
getndelim2: Silence gcc warning.

* lib/getndelim2.c: Add #pragma GCC diagnostic.
(IF_LINT): Remove macro.
(getndelim2): Remove use of IF_LINT.

23 months agocanonicalize: Silence gcc warning.
Bruno Haible [Thu, 18 May 2023 22:45:46 +0000 (00:45 +0200)]
canonicalize: Silence gcc warning.

* lib/canonicalize.c: Add #pragma GCC diagnostic.
(IF_LINT): Remove macro.
(canonicalize_filename_mode_stk): Remove use of IF_LINT.

23 months agovasnprintf, c-vasnprintf: Silence gcc warning.
Bruno Haible [Thu, 18 May 2023 20:58:23 +0000 (22:58 +0200)]
vasnprintf, c-vasnprintf: Silence gcc warning.

* lib/vasnprintf.c: Add #pragma GCC diagnostic.

23 months agonstrftime: Silence gcc warning.
Bruno Haible [Thu, 18 May 2023 20:46:47 +0000 (22:46 +0200)]
nstrftime: Silence gcc warning.

* lib/nstrftime.c: Add #pragma GCC diagnostic.

23 months agoastrxfrm: Silence gcc warning.
Bruno Haible [Thu, 18 May 2023 20:37:20 +0000 (22:37 +0200)]
astrxfrm: Silence gcc warning.

* lib/astrxfrm.c: Add #pragma GCC diagnostic.

23 months agovasnprintf, c-vasnprintf: Silence gcc warnings.
Bruno Haible [Thu, 18 May 2023 20:51:17 +0000 (22:51 +0200)]
vasnprintf, c-vasnprintf: Silence gcc warnings.

* lib/vasnprintf.c (scale10_round_decimal_decoded): Remove memory==NULL
test.
(scale10_round_decimal_long_double, scale10_round_decimal_double): Test
for memory==NULL here. Remove use of IF_LINT.

23 months agobitset: Silence gcc warning.
Bruno Haible [Thu, 18 May 2023 20:40:12 +0000 (22:40 +0200)]
bitset: Silence gcc warning.

* lib/bitset/list.c (lbitset_copy_): Remove redundant test from the
loop's first iteration.

23 months agostack: Silence gcc warning in tests.
Bruno Haible [Thu, 18 May 2023 20:48:54 +0000 (22:48 +0200)]
stack: Silence gcc warning in tests.

* lib/stack.h (init, destroy, empty, current_base, push, pop, discard,
top, size): Mark as possibly unused.

23 months agohamt: Silence gcc warning.
Bruno Haible [Thu, 18 May 2023 20:45:45 +0000 (22:45 +0200)]
hamt: Silence gcc warning.

* lib/hamt.c (init_element): Mark as possibly unused.

23 months agoget-rusage-data: Silence gcc warning.
Bruno Haible [Thu, 18 May 2023 20:43:14 +0000 (22:43 +0200)]
get-rusage-data: Silence gcc warning.

* lib/get-rusage-data.c (get_rusage_data_via_iterator): Mark as possibly
unused.

23 months agoastrxfrm: Fix use-after-free bug.
Bruno Haible [Thu, 18 May 2023 16:01:06 +0000 (18:01 +0200)]
astrxfrm: Fix use-after-free bug.

* lib/astrxfrm.c (astrxfrm): Don't use memcpy after realloc succeeded.

23 months agognulib-tool: Ignore .orig and .rej files under modules/.
Bruno Haible [Thu, 18 May 2023 20:38:30 +0000 (22:38 +0200)]
gnulib-tool: Ignore .orig and .rej files under modules/.

23 months agognulib-tool: Ignore .orig and .rej files under modules/.
Bruno Haible [Thu, 18 May 2023 14:03:00 +0000 (16:03 +0200)]
gnulib-tool: Ignore .orig and .rej files under modules/.

* gnulib-tool (func_sanitize_modulelist): Exclude also files whose name
ends in .orig or .rej.
* pygnulib/GLModuleSystem.py (GLModuleSystem.file_is_module): Likewise.

23 months agouchar: Fix error when <uchar.h> is included twice.
Bruno Haible [Thu, 18 May 2023 13:39:19 +0000 (15:39 +0200)]
uchar: Fix error when <uchar.h> is included twice.

* lib/uchar.in.h: Fix double-inclusion guard.

23 months agostdckdint: use in parse-datetime
Paul Eggert [Wed, 17 May 2023 19:38:28 +0000 (12:38 -0700)]
stdckdint: use in parse-datetime

* lib/parse-datetime.y (apply_relative_time, zone, date)
(iso_8601_date, relunit, relunit_snumber, time_zone_hhmm)
(to_tm_year, yylex, parse_datetime_body):
Prefer ckd_add to INT_ADD_WRAPV etc., and include stdckdint.h.
* modules/parse-datetime (Depends-on): Add stdckdint.