]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix DSO symbol test with MINGW64 and pedantic warnings
authorMilan Broz <gmazyland@gmail.com>
Wed, 22 Apr 2026 13:39:29 +0000 (15:39 +0200)
committerNorbert Pocs <norbertp@openssl.org>
Thu, 30 Apr 2026 11:41:57 +0000 (13:41 +0200)
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)

test/simpledynamic.c

index b3d3d2a59b77006bb763397a5f67c5b29f53fbb2..5918797cd6a151292a08b9dd6133021a1ddf9611 100644 (file)
@@ -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;
 }