summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2026-05-09 17:56:54 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2026-05-09 17:56:54 +0200
commit15612a69dd5bb9dbad09e7095dc69ba96997c23b (patch)
tree36fd5957c604f96e283229e0429aed345b4c5583
parent9a01a96702fcc37ed10d0bece56bfddf4387b274 (diff)
parent1f8a958cf61bc473bb0aa05a133ad40412910811 (diff)
Update upstream source from tag 'upstream/5.4'
Update to upstream version '5.4' with Debian dir dfa54d2313558d6119cccdcfa146b3f044f439d5
-rw-r--r--Makefile.in3
-rwxr-xr-xconfigure26
-rw-r--r--configure.ac4
-rw-r--r--doc/changelog.rst7
-rw-r--r--include/libHX/option.h1
-rw-r--r--src/format.c4
-rw-r--r--src/opt.c14
-rw-r--r--src/proc.c7
-rw-r--r--src/socket.c12
-rw-r--r--src/string.c11
-rw-r--r--src/tc-netio.c1
-rw-r--r--src/tc-proc.c1
-rw-r--r--src/tc-socket.c1
-rw-r--r--src/tc-string.c1
14 files changed, 65 insertions, 28 deletions
diff --git a/Makefile.in b/Makefile.in
index 5e6dce7..926d1e2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -199,7 +199,8 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/build-aux/ltmain.sh \
$(top_srcdir)/build-aux/missing COPYING build-aux/ar-lib \
build-aux/compile build-aux/config.guess build-aux/config.sub \
- build-aux/install-sh build-aux/ltmain.sh build-aux/missing
+ build-aux/depcomp build-aux/install-sh build-aux/ltmain.sh \
+ build-aux/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
diff --git a/configure b/configure
index 4265bd9..ef06185 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for libHX 5.3.
+# Generated by GNU Autoconf 2.72 for libHX 5.4.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation,
@@ -611,8 +611,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libHX'
PACKAGE_TARNAME='libhx'
-PACKAGE_VERSION='5.3'
-PACKAGE_STRING='libHX 5.3'
+PACKAGE_VERSION='5.4'
+PACKAGE_STRING='libHX 5.4'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1374,7 +1374,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures libHX 5.3 to adapt to many kinds of systems.
+'configure' configures libHX 5.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1445,7 +1445,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libHX 5.3:";;
+ short | recursive ) echo "Configuration of libHX 5.4:";;
esac
cat <<\_ACEOF
@@ -1560,7 +1560,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libHX configure 5.3
+libHX configure 5.4
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -2213,7 +2213,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libHX $as_me 5.3, which was
+It was created by libHX $as_me 5.4, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -3910,7 +3910,7 @@ fi
# Define the identity of the package.
PACKAGE='libhx'
- VERSION='5.3'
+ VERSION='5.4'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -19145,6 +19145,12 @@ then :
printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h
fi
+ac_fn_c_check_header_compile "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default"
+if test "x$ac_cv_header_strings_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_STRINGS_H 1" >>confdefs.h
+
+fi
ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_resource_h" = xyes
then :
@@ -20393,7 +20399,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libHX $as_me 5.3, which was
+This file was extended by libHX $as_me 5.4, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20461,7 +20467,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-libHX config.status 5.3
+libHX config.status 5.4
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index b59122d..785f2b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([libHX], [5.3])
+AC_INIT([libHX], [5.4])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
@@ -62,7 +62,7 @@ AC_SUBST([pkgconfigdir])
CHECK_GCC_FVISIBILITY
CHECK_LD_SYMVERS
LIBS_system="$LIBS"
-AC_CHECK_HEADERS([dlfcn.h sys/resource.h sys/un.h])
+AC_CHECK_HEADERS([dlfcn.h strings.h sys/resource.h sys/un.h])
AM_CONDITIONAL([HAVE_DLFCN_H], [test "$ac_cv_header_dlfcn_h" = "yes"])
AC_SEARCH_LIBS([dlopen], [dl], [libdl_LIBS="$LIBS"; LIBS="$LIBS_system"])
AC_SUBST([libdl_LIBS])
diff --git a/doc/changelog.rst b/doc/changelog.rst
index 2fd3b9b..f7ae3e7 100644
--- a/doc/changelog.rst
+++ b/doc/changelog.rst
@@ -1,3 +1,10 @@
+v5.4 (2026-03-25)
+=================
+
+* Resolved some compile warnings/errors with newer
+ compilers, libcs, and -std modes.
+
+
v5.3 (2026-01-29)
=================
diff --git a/include/libHX/option.h b/include/libHX/option.h
index 9eff6a9..1c0cb53 100644
--- a/include/libHX/option.h
+++ b/include/libHX/option.h
@@ -8,6 +8,7 @@
# include <stddef.h>
# include <stdio.h>
#endif
+#include <sys/types.h>
#include <libHX/cast.h>
#ifdef __cplusplus
diff --git a/src/format.c b/src/format.c
index 985a527..18e3f5e 100644
--- a/src/format.c
+++ b/src/format.c
@@ -153,9 +153,9 @@ EXPORT_SYMBOL int HXformat_add(struct HXformat_map *blk, const char *key,
static __inline__ char *HX_strchr0(const char *s, char c)
{
- char *ret = strchr(s, c);
+ const char *ret = strchr(s, c);
if (ret != NULL)
- return ret;
+ return const_cast1(char *, ret);
return const_cast1(char *, s) + strlen(s);
}
diff --git a/src/opt.c b/src/opt.c
index 118c159..6e3d032 100644
--- a/src/opt.c
+++ b/src/opt.c
@@ -7,6 +7,9 @@
* General Public License as published by the Free Software Foundation;
* either version 2.1 or (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
@@ -15,6 +18,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
#include <libHX/ctype_helper.h>
#include <libHX/deque.h>
#include <libHX/map.h>
@@ -561,13 +567,13 @@ static int HX_getopt_long(const char *cur, struct HX_getopt_vars *par)
return -EINVAL;
}
*value = '\0';
- value = strchr(cur, '=');
- if (value == nullptr) {
+ const char *cvalue = strchr(cur, '=');
+ if (cvalue == nullptr) {
/* Cannot happen either */
free(key);
return -EINVAL;
}
- ++value;
+ ++cvalue;
par->cbi.current = lookup_long_pfx(par->cbi.table, key + 2);
if (par->cbi.current == &HXopt_ambig_prefix) {
ret = HX_getopt_error(HXOPT_E_AMBIG_PREFIX, key, par->flags);
@@ -591,7 +597,7 @@ static int HX_getopt_long(const char *cur, struct HX_getopt_vars *par)
free(key);
par->cbi.flags = HXOPTCB_BY_LONG;
- par->cbi.data = value;
+ par->cbi.data = const_cast(char *, cvalue);
/*
* Not possible to use %HXOPT_I_ASSIGN due to transience of @key. Thus
* manually call do_assign now rather than in the superordinate
diff --git a/src/proc.c b/src/proc.c
index c8957b6..a4bc6ab 100644
--- a/src/proc.c
+++ b/src/proc.c
@@ -1,6 +1,6 @@
/*
* Process management
- * Copyright Jan Engelhardt, 2008-2009
+ * Copyright Jan Engelhardt, 2026
*
* This file is part of libHX. libHX is free software; you can
* redistribute it and/or modify it under the terms of the GNU Lesser
@@ -10,6 +10,10 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
+#define _DEFAULT_SOURCE
+#ifdef __CYGWIN__
+# define _BSD_SOURCE /* initgroups */
+#endif
#include "internal.h"
#include <errno.h>
#include <limits.h>
@@ -21,7 +25,6 @@
#ifdef _WIN32
# include <winsock2.h>
#endif
-
#if defined(HAVE_INITGROUPS) && defined(HAVE_SETGID)
#include <grp.h>
#include <pwd.h>
diff --git a/src/socket.c b/src/socket.c
index fe813f5..47c7e38 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -1,6 +1,6 @@
/*
* Socket-related functions
- * Copyright Jan Engelhardt, 2021
+ * Copyright Jan Engelhardt, 2026
*
* This file is part of libHX. libHX is free software; you can
* redistribute it and/or modify it under the terms of the GNU Lesser
@@ -10,6 +10,10 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
+#define _POSIX_C_SOURCE 999900L /* cygwin-need:freeaddrinfo */
+#ifdef __OpenBSD__
+# define _BSD_SOURCE
+#endif
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
@@ -262,11 +266,11 @@ int HX_local_listen(const char *path)
struct sockaddr_un u;
if (strlen(path) >= sizeof(u.sun_path))
return -EINVAL;
- u.sun_family = AF_LOCAL;
+ u.sun_family = AF_UNIX;
strcpy(u.sun_path, path);
struct addrinfo r = {};
r.ai_flags = AI_PASSIVE;
- r.ai_family = AF_LOCAL;
+ r.ai_family = AF_UNIX;
r.ai_socktype = SOCK_STREAM;
r.ai_addrlen = sizeof(u) - sizeof(u.sun_path) + strlen(u.sun_path) + 1;
r.ai_addr = reinterpret_cast(struct sockaddr *, &u);
@@ -289,7 +293,7 @@ int HX_local_listen(const char *path)
if (!S_ISSOCK(sb.st_mode))
return -ENOTSOCK;
- int testfd = socket(AF_LOCAL, SOCK_STREAM | PLATFORM_SKFLAGS, 0);
+ int testfd = socket(AF_UNIX, SOCK_STREAM | PLATFORM_SKFLAGS, 0);
if (testfd < 0)
return -errno;
ret = connect(testfd, r.ai_addr, r.ai_addrlen);
diff --git a/src/string.c b/src/string.c
index e9c162d..445b466 100644
--- a/src/string.c
+++ b/src/string.c
@@ -7,6 +7,9 @@
* General Public License as published by the Free Software Foundation;
* either version 2.1 or (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include <errno.h>
#include <limits.h>
#include <math.h> /* nextafter */
@@ -16,6 +19,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
#include <libHX/ctype_helper.h>
#include <libHX/string.h>
#include "internal.h"
@@ -176,7 +182,6 @@ EXPORT_SYMBOL void *HX_memmem(const void *vspace, size_t spacesize,
const char *space = vspace, *point = vpoint;
const char *head, *end;
size_t tailsize;
- char *tail;
if (pointsize == 0)
return const_cast1(void *, vspace);
@@ -185,9 +190,9 @@ EXPORT_SYMBOL void *HX_memmem(const void *vspace, size_t spacesize,
/* Do a BM-style trailer search and reduce calls to memcmp */
head = space + (pointsize - 1);
- tail = memchr(head, point[pointsize-1], spacesize - (pointsize - 1));
+ const char *tail = memchr(head, point[pointsize-1], spacesize - (pointsize - 1));
if (tail == NULL || pointsize == 1)
- return tail;
+ return const_cast1(char *, tail);
end = space + spacesize;
do {
head = tail - pointsize + 1;
diff --git a/src/tc-netio.c b/src/tc-netio.c
index 4510d0a..d3c2929 100644
--- a/src/tc-netio.c
+++ b/src/tc-netio.c
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: MIT
#define WIN32_LEAN_AND_MEAN 1
+#define _POSIX_C_SOURCE 999900L /* cygwin-need:freeaddrinfo */
#ifdef __cplusplus
# include <cstdlib>
# include <cstdio>
diff --git a/src/tc-proc.c b/src/tc-proc.c
index c17b232..9af1eba 100644
--- a/src/tc-proc.c
+++ b/src/tc-proc.c
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: MIT
+#define _POSIX_C_SOURCE 999900L /* cygwin:fdopen */
#ifdef __cplusplus
# include <cerrno>
# include <cstdio>
diff --git a/src/tc-socket.c b/src/tc-socket.c
index 2c140a1..dafe509 100644
--- a/src/tc-socket.c
+++ b/src/tc-socket.c
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: MIT
+#define _POSIX_C_SOURCE 999900L
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/tc-string.c b/src/tc-string.c
index 1c67ede..7c3034d 100644
--- a/src/tc-string.c
+++ b/src/tc-string.c
@@ -1,5 +1,6 @@
/* long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing long line for testing */
// SPDX-License-Identifier: MIT
+#define _POSIX_C_SOURCE 909900L
#ifndef __cplusplus
# include <assert.h>
# include <errno.h>