]> git.kaiwu.me - nginx.git/commitdiff
Win32: silenced -Wcast-function-type GCC warning (ticket #1865).
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 21 Oct 2019 16:07:03 +0000 (19:07 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 21 Oct 2019 16:07:03 +0000 (19:07 +0300)
With MinGW-w64, building 64-bit nginx binary with GCC 8 and above
results in warning due to cast of GetProcAddress() result to ngx_wsapoll_pt,
which GCC thinks is incorrect.  Added intermediate cast to "void *" to
silence the warning.

src/os/win32/ngx_win32_init.c

index 70bee8ef43ab7efba4dfd63512dcb745632737cd..3249fb293251a225d6c9be9235551afed41e49ec 100644 (file)
@@ -240,7 +240,7 @@ ngx_os_init(ngx_log_t *log)
         goto nopoll;
     }
 
-    WSAPoll = (ngx_wsapoll_pt) GetProcAddress(hmod, "WSAPoll");
+    WSAPoll = (ngx_wsapoll_pt) (void *) GetProcAddress(hmod, "WSAPoll");
     if (WSAPoll == NULL) {
         ngx_log_error(NGX_LOG_NOTICE, log, ngx_errno,
                       "GetProcAddress(\"WSAPoll\") failed");