Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some warnings on compile #10603

Closed
Keitagit-kun opened this issue Feb 24, 2023 · 3 comments
Closed

Some warnings on compile #10603

Keitagit-kun opened this issue Feb 24, 2023 · 3 comments
Assignees
Labels
build cmake HTTP/3 h3 or quic related Windows Windows-specific

Comments

@Keitagit-kun
Copy link

I'm compiling curl 7.88.1 (+OpenSSL 3.0.8 quic, libssh2/1.10.0, LibZ 1.2.13, Ares 1.17.2, Brotli 1.0.9, zstd 1.5.4, nghttp2 1.52.0, ngtcp2/0.13.1, nghttp3/0.8.0)
cmake + compiler: mingw-w64 x86_64-7.2.0-win32-seh-rt_v5-rev1

curl version=[7.88.1]
Could NOT find LibPSL (missing: LIBPSL_LIBRARY LIBPSL_INCLUDE_DIR) 
Performing Curl Test HAVE_WIN32_WINNT
Performing Curl Test HAVE_WIN32_WINNT - Success
Found _WIN32_WINNT=0x502
LTO supported and enabled
Enabled features: SSL IPv6 unixsockets libz brotli zstd AsynchDNS Largefile alt-svc HSTS NTLM HTTP2 HTTP3 HTTPS-proxy unicode threadsafe
Enabled protocols: DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS LDAP MQTT POP3 POP3S RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP
Enabled SSL backends: OpenSSL
Configuring done
Generating done

On compile (successful) there a few warnings:

Scanning dependencies of target libcurl
[  0%] Building C object lib/CMakeFiles/libcurl.dir/altsvc.c.obj
[  1%] Building C object lib/CMakeFiles/libcurl.dir/amigaos.c.obj
[  1%] Building C object lib/CMakeFiles/libcurl.dir/asyn-ares.c.obj
[  2%] Building C object lib/CMakeFiles/libcurl.dir/asyn-thread.c.obj
[  3%] Building C object lib/CMakeFiles/libcurl.dir/base64.c.obj
...
[ 94%] Building C object lib/CMakeFiles/libcurl.dir/vtls/wolfssl.c.obj
[ 95%] Building C object lib/CMakeFiles/libcurl.dir/vtls/x509asn1.c.obj
[ 95%] Building C object lib/CMakeFiles/libcurl.dir/vquic/curl_msh3.c.obj
[ 96%] Building C object lib/CMakeFiles/libcurl.dir/vquic/curl_ngtcp2.c.obj
C:\Temp\curl 7.88.1-OpenSSL3\curl-7.88.1\lib\vquic\curl_ngtcp2.c: In function 'qlog_callback':
C:\Temp\curl 7.88.1-OpenSSL3\curl-7.88.1\lib\vquic\curl_ngtcp2.c:208:43: warning: conversion to 'unsigned int' from 'size_t {aka long long unsigned int}' may alter its value [-Wconversion]
     ssize_t rc = write(ctx->qlogfd, data, datalen);
                                           ^~~~~~~
C:\Temp\curl 7.88.1-OpenSSL3\curl-7.88.1\lib\vquic\curl_ngtcp2.c: In function 'cf_process_ingress':
C:\Temp\curl 7.88.1-OpenSSL3\curl-7.88.1\lib\vquic\curl_ngtcp2.c:1775:57: warning: conversion to 'int' from 'size_t {aka long long unsigned int}' may alter its value [-Wconversion]
     while((recvd = recvfrom(ctx->q.sockfd, (char *)buf, bufsize, 0,
                                                         ^~~~~~~
C:\Temp\curl 7.88.1-OpenSSL3\curl-7.88.1\lib\vquic\curl_ngtcp2.c: In function 'cf_ngtcp2_close':
C:\Temp\curl 7.88.1-OpenSSL3\curl-7.88.1\lib\vquic\curl_ngtcp2.c:2179:42: warning: conversion to 'int' from 'ngtcp2_ssize {aka long long int}' may alter its value [-Wconversion]
       while((send(ctx->q.sockfd, buffer, rc, 0) == -1) &&
                                          ^~
C:\Temp\curl 7.88.1-OpenSSL3\curl-7.88.1\lib\vquic\curl_ngtcp2.c: In function 'cf_ngtcp2_destroy':
C:\Temp\curl 7.88.1-OpenSSL3\curl-7.88.1\lib\vquic\curl_ngtcp2.c:2193:23: warning: variable 'save' set but not used [-Wunused-but-set-variable]
   struct cf_call_data save;
                       ^~~~
[ 96%] Building C object lib/CMakeFiles/libcurl.dir/vquic/curl_quiche.c.obj
[ 97%] Building C object lib/CMakeFiles/libcurl.dir/vquic/vquic.c.obj
C:\Temp\curl 7.88.1-OpenSSL3\curl-7.88.1\lib\vquic\vquic.c: In function 'do_sendmsg':
C:\Temp\curl 7.88.1-OpenSSL3\curl-7.88.1\lib\vquic\vquic.c:170:55: warning: conversion to 'int' from 'size_t {aka long long unsigned int}' may alter its value [-Wconversion]
   while((sent = send(qctx->sockfd, (const char *)pkt, pktlen, 0)) == -1 &&
                                                       ^~~~~~
[ 98%] Building C object lib/CMakeFiles/libcurl.dir/vssh/libssh.c.obj
[ 98%] Building C object lib/CMakeFiles/libcurl.dir/vssh/libssh2.c.obj
[ 99%] Building C object lib/CMakeFiles/libcurl.dir/vssh/wolfssh.c.obj
[100%] Linking C static library libcurl.a
[100%] Built target libcurl

I'm ignoring them... but maybe it can be fixed or silensed...

@bagder
Copy link
Member

bagder commented Feb 24, 2023

I think this shows we need to setup an ngtcp2 CI job on Windows...

@icing
Copy link
Contributor

icing commented Feb 24, 2023

I think this shows we need to setup an ngtcp2 CI job on Windows...

Ooof. Need to build all prerequisites there? Need some help for that, I guess.

@vszakats
Copy link
Member

vszakats commented Feb 24, 2023

I could reproduce these with curl-for-win when using CMake (even with the default clang).
When building with gcc, there are also these extra ones in the Schannel code:

~/curl/lib/vtls/schannel.c: In function 'schannel_connect_step1':
~/curl/lib/vtls/schannel.c:1204:12: warning: conversion from 'long long unsigned int' to 'int' may change value [-Warith-conversion]
 1204 |     cur += sizeof(unsigned int);
      |            ^~~~~~
~/curl/lib/vtls/schannel.c:1210:12: warning: conversion from 'long long unsigned int' to 'int' may change value [-Warith-conversion]
 1210 |     cur += sizeof(unsigned int);
      |            ^~~~~~
~/curl/lib/vtls/schannel.c:1215:12: warning: conversion from 'long long unsigned int' to 'int' may change value [-Warith-conversion]
 1215 |     cur += sizeof(unsigned short);
      |            ^~~~~~
~/curl/lib/vtls/schannel.c:1228:22: warning: conversion from 'long long unsigned int' to 'unsigned int' may change value [-Warith-conversion]
 1228 |     *extension_len = *list_len + sizeof(unsigned int) + sizeof(unsigned short);
      |                      ^
At top level:

Build log (clang): https://ci.appveyor.com/project/curlorg/curl-for-win/builds/46332190

@bagder bagder added the HTTP/3 h3 or quic related label Feb 24, 2023
vszakats added a commit to curl/curl-for-win that referenced this issue Feb 25, 2023
The idea is to help launching a curl-for-win build from a curl CI
session, or outside CI, on a local machine. It supports cross-builds
from Debian, macOS, or MSYS2 (untested).

I've been using a similar script for local tests for a long time.

Builds support llvm/clang (default) or gcc, for curl it supports
GNU make, CMake and Makefile.mk (default). For CPU, it supports
64-bit, 32-bit and ARM 64-bit.

It supports predefined configurations, with options to enable c-ares,
wolfssl, wolfssh, libssh, mbedtls, libressl, boringssl, libpsl,
libidn2. You can select mainline openssl (e.g. 3.1.0 beta) by disabling
HTTP/3. See the list under `CW_CONFIG` inside `./_build.sh`.

The default config is x64-only, using latest curl and libssh2 master
branches, with c-ares and libpsl over the official curl Windows
binaries. You can customize curl/libssh2 branches via `CURL_REV_` and
`LIBSSH2_REV_`.

These builds use a local (automatically downloaded) copy of
`llvm-mingw`, and trivial set of apt/brew/msys2 packages. Plus go/nasm
for boringssl builds.

The build skips code signing, packages signing and package uploads.

The script downloads and builds everything necessary according
to the versions listed in `./_versions.sh`. I used to bump these to
their latest versions using `./_bump.sh`.

Consider this a WIP and EXPERIMENTAL.

Ref: curl/curl#10603
vszakats added a commit to vszakats/curl that referenced this issue Feb 27, 2023
Fixes curl#10603
Closes #xxxxx
@bagder bagder closed this as completed in 51211a3 Feb 28, 2023
bch pushed a commit to bch/curl that referenced this issue Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build cmake HTTP/3 h3 or quic related Windows Windows-specific
Development

Successfully merging a pull request may close this issue.

4 participants