Cast via uintptr_t function pointer between object pointer

- ISO C forbids conversion of function pointer to object pointer type
- ISO C forbids conversion of object pointer to function pointer type
This commit is contained in:
Nobuyoshi Nakada 2024-10-08 15:41:28 +09:00 committed by Nobuyoshi Nakada
parent d8b64eac55
commit 9a90cd2284
19 changed files with 29 additions and 25 deletions

4
dln.c
View file

@ -437,7 +437,7 @@ dln_sym(void *handle, const char *symbol)
#endif
}
static void *
static uintptr_t
dln_sym_func(void *handle, const char *symbol)
{
void *func = dln_sym(handle, symbol);
@ -453,7 +453,7 @@ dln_sym_func(void *handle, const char *symbol)
#endif
dln_loaderror("%s - %s", error, symbol);
}
return func;
return (uintptr_t)func;
}
#define dln_sym_callable(rettype, argtype, handle, symbol) \