Skip to content

lib: fix gcc8 warning on Windows - #2979

Closed
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:gcc8win
Closed

vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:gcc8win

Conversation

@vszakats

Copy link
Copy Markdown
Member

No description provided.

@jay

jay commented Sep 12, 2018

Copy link
Copy Markdown
Member

The existing code looks correct. What's warning do you see?

@vszakats

vszakats commented Sep 12, 2018 •

Copy link
Copy Markdown
Member Author

@jay:

i686-w64-mingw32-gcc -I. -I../include -I"../../nghttp2/pkg/usr/local/include" -I"../../libssh2/include" -I"../../libssh2/win32" -I"../../openssl/include" -I"../../zlib/pkg/usr/local" -I"../../brotli/pkg/usr/local/include" -DCURL_STATICLIB -fno-ident -DCURL_DISABLE_SSL_AUTO_LOAD_CONFIG -fno-asynchronous-unwind-tables -DNGHTTP2_STATICLIB -g -O2 -Wall -W -fno-strict-aliasing -m32 -DBUILDING_LIBCURL -DCURL_WITH_MULTI_SSL -DUSE_NGHTTP2 -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H -DUSE_OPENSSL -DHAVE_OPENSSL_ENGINE_H -DHAVE_OPENSSL_PKCS12_H -DHAVE_ENGINE_LOAD_BUILTIN_ENGINES -DOPENSSL_NO_KRB5 -DHAVE_OPENSSL_SRP -DUSE_TLS_SRP -DUSE_SCHANNEL -DHAVE_LIBZ -DHAVE_ZLIB_H -DHAVE_BROTLI -DUSE_WIN32_IDN -DWANT_IDN_PROTOTYPES -DUSE_WINDOWS_SSPI -DENABLE_IPV6 -D_WIN32_WINNT=0x0501 -DHAVE_LDAP_SSL -c curl_sspi.c -o curl_sspi.o
curl_sspi.c: In function 'Curl_sspi_global_init':
curl_sspi.c:93:30: warning: cast between incompatible function types from 'FARPROC' to 'struct _SECURITY_FUNCTION_TABLE_A * (__attribute__((stdcall)) *)(void)' [-Wcast-function-type]
     pInitSecurityInterface = (INITSECURITYINTERFACE_FN)
                              ^

Code is correct, but gcc 8 complains about casting function pointers for this case — a typical one for most Windows code. Other instances of the same case were suppressed earlier, and to make it easier, the CURLX_FUNCTION_CAST() macro was also added.

@vszakats vszakats added build Windows Windows-specific labels Sep 12, 2018
@jay

jay commented Sep 12, 2018

Copy link
Copy Markdown
Member

Ok

@vszakats vszakats closed this in 539a805 Sep 12, 2018
@vszakats
vszakats deleted the gcc8win branch September 12, 2018 08:53
@lock lock Bot locked as resolved and limited conversation to collaborators Dec 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

build Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

3 participants