summaryrefslogtreecommitdiff
path: root/src/shared/idn-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-11-16 21:37:20 +0100
committerLennart Poettering <lennart@poettering.net>2022-11-21 16:13:17 +0100
commit7736a71fd2c4f0704db2e0d110959f817829cb85 (patch)
treecf46ad874a24607341e783fac5de3109ed6e629b /src/shared/idn-util.c
parent28795f2c138203fb700fc394f0937708af886116 (diff)
downloadsystemd-7736a71fd2c4f0704db2e0d110959f817829cb85.tar.gz
dlfcn-util: add static asserts ensuring our sym_xyz() func ptrs match the types from the official headers
Make sure that the sym_xyz function pointers have the types that the functions we'll assign them have. And of course, this found a number of incompatibilities right-away, in particular in the bpf hookup. (Doing this will trigger deprecation warnings from libbpf. I simply turned them off locally now, since we are well aware of what we are doing in that regard.) There's one return type fix (bool → int), that actually matters I think, as it might have created an incompatibility on some archs.
Diffstat (limited to 'src/shared/idn-util.c')
-rw-r--r--src/shared/idn-util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/idn-util.c b/src/shared/idn-util.c
index d4108d0c8e..6f36688dc0 100644
--- a/src/shared/idn-util.c
+++ b/src/shared/idn-util.c
@@ -17,7 +17,7 @@ static void* idn_dl = NULL;
#if HAVE_LIBIDN2
int (*sym_idn2_lookup_u8)(const uint8_t* src, uint8_t** lookupname, int flags) = NULL;
-const char *(*sym_idn2_strerror)(int rc) = NULL;
+const char *(*sym_idn2_strerror)(int rc) _const_ = NULL;
int (*sym_idn2_to_unicode_8z8z)(const char * input, char ** output, int flags) = NULL;
int dlopen_idn(void) {
@@ -31,7 +31,7 @@ int dlopen_idn(void) {
#if HAVE_LIBIDN
int (*sym_idna_to_ascii_4i)(const uint32_t * in, size_t inlen, char *out, int flags);
-int (*sym_idna_to_unicode_44i)(const uint32_t * in, size_t inlen,uint32_t * out, size_t * outlen, int flags);
+int (*sym_idna_to_unicode_44i)(const uint32_t * in, size_t inlen, uint32_t * out, size_t * outlen, int flags);
char* (*sym_stringprep_ucs4_to_utf8)(const uint32_t * str, ssize_t len, size_t * items_read, size_t * items_written);
uint32_t* (*sym_stringprep_utf8_to_ucs4)(const char *str, ssize_t len, size_t *items_written);