curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Reducing windows compiler warnings

From: Sergei Nikulov via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 5 Jul 2017 09:24:05 +0300

2017-07-05 1:57 GMT+03:00 Daniel Stenberg <daniel_at_haxx.se>:
> Hi,
>
> I could use some help here!
>
> I'd like to reduce, or ideally remove all, compiler warnings in our Travis
> CI builds for Windows so that we can switch on "warnings as errors" and thus
> better detect when we rock the boat. Having github turn pull-requests red is
> such a handy tool for helping us get stellar work already before merging to
> master.
>
> The primary CI build for this is using cmake and MSVC, and I noticed two
> main problems: 1) inet_pton() causes warnings and 2) sread/swrite do as
> well.
>
> Problem 1:
>
> I've tried (but failed) top address here:
>
> https://github.com/curl/curl/pull/1639
>
> ... but even then, the build generates inet_pton warnings, like here:
>
> https://ci.appveyor.com/project/curlorg/curl/build/7.50.0.5120/job/udjiikpya8gykxqo
>
> But I don't understand why. Isn't the inet_pton() proto in winsock2.h on
> windows?
>

AFAIR, inet_pton is defined since Windows Vista, according to
https://msdn.microsoft.com/en-us/library/windows/desktop/cc805844(v=vs.85).aspx

This definition will break this rules
add_definitions(-D_WIN32_WINNT=0x0501)

This will explicitly enforce Windows XP, so I suspect inet_pton exists
in libraries but disabled in headers.

> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
> Etiquette: https://curl.haxx.se/mail/etiquette.html

-- 
Best Regards,
Sergei Nikulov
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-07-05