Commit 26a269fe00 for openssl.org
commit 26a269fe0077eab2cd55636cec366259cdef061f
Author: Milan Broz <gmazyland@gmail.com>
Date: Wed Apr 22 15:39:29 2026 +0200
Fix DSO symbol test with MINGW64 and pedantic warnings
GetProcAddress() cannot be simple cast to void* (SD_SYM)
under strict warnigs, as it produces this
error: ISO C forbids conversion of function pointer to
object pointer type [-Werror=pedantic]
Use common trick with cast to (uintptr_t).
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Apr 30 11:42:33 2026
(Merged from https://github.com/openssl/openssl/pull/30941)
diff --git a/test/simpledynamic.c b/test/simpledynamic.c
index b3d3d2a59b..5918797cd6 100644
--- a/test/simpledynamic.c
+++ b/test/simpledynamic.c
@@ -52,7 +52,7 @@ int sd_load(const char *filename, SD *lib, ossl_unused int type)
int sd_sym(SD lib, const char *symname, SD_SYM *sym)
{
- *sym = (SD_SYM)GetProcAddress(lib, symname);
+ *sym = (SD_SYM)(uintptr_t)GetProcAddress(lib, symname);
return *sym != NULL;
}