Welcome! Log In Create A New Profile

Advanced

[nginx] Win32: silenced -Wcast-function-type GCC warning (ticket #1865).

Maxim Dounin
October 21, 2019 12:12PM
details: https://hg.nginx.org/nginx/rev/4f6e315eef15
branches:
changeset: 7586:4f6e315eef15
user: Maxim Dounin <mdounin@mdounin.ru>
date: Mon Oct 21 19:07:03 2019 +0300
description:
Win32: silenced -Wcast-function-type GCC warning (ticket #1865).

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.

diffstat:

src/os/win32/ngx_win32_init.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff --git a/src/os/win32/ngx_win32_init.c b/src/os/win32/ngx_win32_init.c
--- a/src/os/win32/ngx_win32_init.c
+++ b/src/os/win32/ngx_win32_init.c
@@ -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");
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Win32: silenced -Wcast-function-type GCC warning (ticket #1865).

Maxim Dounin 241 October 21, 2019 12:12PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 297
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready