build: enable missing OpenSSF-recommended warnings, with fixes
—
$ git checkout -f 3829759bd042c03225ae862062560f568ba1a231
Previous HEAD position was c1bc090d65 windows: simplify detecting and using system headers
HEAD is now at 3829759bd0 build: enable missing OpenSSF-recommended warnings, with fixes
$ git clean -fdx
Removing Makefile
Removing Makefile.in
Removing aclocal.m4
Removing autom4te.cache/
Removing compile
Removing config.guess
Removing config.log
Removing config.status
Removing config.sub
Removing configure
Removing curl-config
Removing depcomp
Removing docs/Makefile
Removing docs/Makefile.in
Removing docs/cmdline-opts/Makefile
Removing docs/cmdline-opts/Makefile.in
Removing docs/curl.1
Removing docs/examples/.deps/
Removing docs/examples/Makefile
Removing docs/examples/Makefile.in
Removing docs/libcurl/Makefile
Removing docs/libcurl/Makefile.in
Removing docs/libcurl/opts/Makefile
Removing docs/libcurl/opts/Makefile.in
Removing include/Makefile
Removing include/Makefile.in
Removing include/curl/Makefile
Removing include/curl/Makefile.in
Removing install-sh
Removing lib/.deps/
Removing lib/.dirstamp
Removing lib/.libs/
Removing lib/Makefile
Removing lib/Makefile.in
Removing lib/base64.o
Removing lib/curl_config.h
Removing lib/curl_config.h.in
Removing lib/curl_multibyte.o
Removing lib/dynbuf.o
Removing lib/libcurl.la
Removing lib/libcurl.plist
Removing lib/libcurl.vers
Removing lib/libcurl_la-altsvc.lo
Removing lib/libcurl_la-altsvc.o
Removing lib/libcurl_la-amigaos.lo
Removing lib/libcurl_la-amigaos.o
Removing lib/libcurl_la-asyn-ares.lo
Removing lib/libcurl_la-asyn-ares.o
Removing lib/libcurl_la-asyn-thread.lo
Removing lib/libcurl_la-asyn-thread.o
Removing lib/libcurl_la-base64.lo
Removing lib/libcurl_la-base64.o
Removing lib/libcurl_la-bufq.lo
Removing lib/libcurl_la-bufq.o
Removing lib/libcurl_la-bufref.lo
Removing lib/libcurl_la-bufref.o
Removing lib/libcurl_la-c-hyper.lo
Removing lib/libcurl_la-c-hyper.o
Removing lib/libcurl_la-cf-h1-proxy.lo
Removing lib/libcurl_la-cf-h1-proxy.o
Removing lib/libcurl_la-cf-h2-proxy.lo
Removing lib/libcurl_la-cf-h2-proxy.o
Removing lib/libcurl_la-cf-haproxy.lo
Removing lib/libcurl_la-cf-haproxy.o
Removing lib/libcurl_la-cf-https-connect.lo
Removing lib/libcurl_la-cf-https-connect.o
Removing lib/libcurl_la-cf-socket.lo
Removing lib/libcurl_la-cf-socket.o
Removing lib/libcurl_la-cfilters.lo
Removing lib/libcurl_la-cfilters.o
Removing lib/libcurl_la-conncache.lo
Removing lib/libcurl_la-conncache.o
Removing lib/libcurl_la-connect.lo
Removing lib/libcurl_la-connect.o
Removing lib/libcurl_la-content_encoding.lo
Removing lib/libcurl_la-content_encoding.o
Removing lib/libcurl_la-cookie.lo
Removing lib/libcurl_la-cookie.o
Removing lib/libcurl_la-curl_addrinfo.lo
Removing lib/libcurl_la-curl_addrinfo.o
Removing lib/libcurl_la-curl_des.lo
Removing lib/libcurl_la-curl_des.o
Removing lib/libcurl_la-curl_endian.lo
Removing lib/libcurl_la-curl_endian.o
Removing lib/libcurl_la-curl_fnmatch.lo
Removing lib/libcurl_la-curl_fnmatch.o
Removing lib/libcurl_la-curl_get_line.lo
Removing lib/libcurl_la-curl_get_line.o
Removing lib/libcurl_la-curl_gethostname.lo
Removing lib/libcurl_la-curl_gethostname.o
Removing lib/libcurl_la-curl_gssapi.lo
Removing lib/libcurl_la-curl_gssapi.o
Removing lib/libcurl_la-curl_memrchr.lo
Removing lib/libcurl_la-curl_memrchr.o
Removing lib/libcurl_la-curl_multibyte.lo
Removing lib/libcurl_la-curl_multibyte.o
Removing lib/libcurl_la-curl_ntlm_core.lo
Removing lib/libcurl_la-curl_ntlm_core.o
Removing lib/libcurl_la-curl_ntlm_wb.lo
Removing lib/libcurl_la-curl_ntlm_wb.o
Removing lib/libcurl_la-curl_path.lo
Removing lib/libcurl_la-curl_path.o
Removing lib/libcurl_la-curl_range.lo
Removing lib/libcurl_la-curl_range.o
Removing lib/libcurl_la-curl_rtmp.lo
Removing lib/libcurl_la-curl_rtmp.o
Removing lib/libcurl_la-curl_sasl.lo
Removing lib/libcurl_la-curl_sasl.o
Removing lib/libcurl_la-curl_sspi.lo
Removing lib/libcurl_la-curl_sspi.o
Removing lib/libcurl_la-curl_threads.lo
Removing lib/libcurl_la-curl_threads.o
Removing lib/libcurl_la-curl_trc.lo
Removing lib/libcurl_la-curl_trc.o
Removing lib/libcurl_la-dict.lo
Removing lib/libcurl_la-dict.o
Removing lib/libcurl_la-doh.lo
Removing lib/libcurl_la-doh.o
Removing lib/libcurl_la-dynbuf.lo
Removing lib/libcurl_la-dynbuf.o
Removing lib/libcurl_la-dynhds.lo
Removing lib/libcurl_la-dynhds.o
Removing lib/libcurl_la-easy.lo
Removing lib/libcurl_la-easy.o
Removing lib/libcurl_la-easygetopt.lo
Removing lib/libcurl_la-easygetopt.o
Removing lib/libcurl_la-easyoptions.lo
Removing lib/libcurl_la-easyoptions.o
Removing lib/libcurl_la-escape.lo
Removing lib/libcurl_la-escape.o
Removing lib/libcurl_la-file.lo
Removing lib/libcurl_la-file.o
Removing lib/libcurl_la-fileinfo.lo
Removing lib/libcurl_la-fileinfo.o
Removing lib/libcurl_la-fopen.lo
Removing lib/libcurl_la-fopen.o
Removing lib/libcurl_la-formdata.lo
Removing lib/libcurl_la-formdata.o
Removing lib/libcurl_la-ftp.lo
Removing lib/libcurl_la-ftp.o
Removing lib/libcurl_la-ftplistparser.lo
Removing lib/libcurl_la-ftplistparser.o
Removing lib/libcurl_la-getenv.lo
Removing lib/libcurl_la-getenv.o
Removing lib/libcurl_la-getinfo.lo
Removing lib/libcurl_la-getinfo.o
Removing lib/libcurl_la-gopher.lo
Removing lib/libcurl_la-gopher.o
Removing lib/libcurl_la-hash.lo
Removing lib/libcurl_la-hash.o
Removing lib/libcurl_la-headers.lo
Removing lib/libcurl_la-headers.o
Removing lib/libcurl_la-hmac.lo
Removing lib/libcurl_la-hmac.o
Removing lib/libcurl_la-hostasyn.lo
Removing lib/libcurl_la-hostasyn.o
Removing lib/libcurl_la-hostip.lo
Removing lib/libcurl_la-hostip.o
Removing lib/libcurl_la-hostip4.lo
Removing lib/libcurl_la-hostip4.o
Removing lib/libcurl_la-hostip6.lo
Removing lib/libcurl_la-hostip6.o
Removing lib/libcurl_la-hostsyn.lo
Removing lib/libcurl_la-hostsyn.o
Removing lib/libcurl_la-hsts.lo
Removing lib/libcurl_la-hsts.o
Removing lib/libcurl_la-http.lo
Removing lib/libcurl_la-http.o
Removing lib/libcurl_la-http1.lo
Removing lib/libcurl_la-http1.o
Removing lib/libcurl_la-http2.lo
Removing lib/libcurl_la-http2.o
Removing lib/libcurl_la-http_aws_sigv4.lo
Removing lib/libcurl_la-http_aws_sigv4.o
Removing lib/libcurl_la-http_chunks.lo
Removing lib/libcurl_la-http_chunks.o
Removing lib/libcurl_la-http_digest.lo
Removing lib/libcurl_la-http_digest.o
Removing lib/libcurl_la-http_negotiate.lo
Removing lib/libcurl_la-http_negotiate.o
Removing lib/libcurl_la-http_ntlm.lo
Removing lib/libcurl_la-http_ntlm.o
Removing lib/libcurl_la-http_proxy.lo
Removing lib/libcurl_la-http_proxy.o
Removing lib/libcurl_la-idn.lo
Removing lib/libcurl_la-idn.o
Removing lib/libcurl_la-if2ip.lo
Removing lib/libcurl_la-if2ip.o
Removing lib/libcurl_la-imap.lo
Removing lib/libcurl_la-imap.o
Removing lib/libcurl_la-inet_ntop.lo
Removing lib/libcurl_la-inet_ntop.o
Removing lib/libcurl_la-inet_pton.lo
Removing lib/libcurl_la-inet_pton.o
Removing lib/libcurl_la-krb5.lo
Removing lib/libcurl_la-krb5.o
Removing lib/libcurl_la-ldap.lo
Removing lib/libcurl_la-ldap.o
Removing lib/libcurl_la-llist.lo
Removing lib/libcurl_la-llist.o
Removing lib/libcurl_la-macos.lo
Removing lib/libcurl_la-macos.o
Removing lib/libcurl_la-md4.lo
Removing lib/libcurl_la-md4.o
Removing lib/libcurl_la-md5.lo
Removing lib/libcurl_la-md5.o
Removing lib/libcurl_la-memdebug.lo
Removing lib/libcurl_la-memdebug.o
Removing lib/libcurl_la-mime.lo
Removing lib/libcurl_la-mime.o
Removing lib/libcurl_la-mprintf.lo
Removing lib/libcurl_la-mprintf.o
Removing lib/libcurl_la-mqtt.lo
Removing lib/libcurl_la-mqtt.o
Removing lib/libcurl_la-multi.lo
Removing lib/libcurl_la-multi.o
Removing lib/libcurl_la-netrc.lo
Removing lib/libcurl_la-netrc.o
Removing lib/libcurl_la-nonblock.lo
Removing lib/libcurl_la-nonblock.o
Removing lib/libcurl_la-noproxy.lo
Removing lib/libcurl_la-noproxy.o
Removing lib/libcurl_la-openldap.lo
Removing lib/libcurl_la-openldap.o
Removing lib/libcurl_la-parsedate.lo
Removing lib/libcurl_la-parsedate.o
Removing lib/libcurl_la-pingpong.lo
Removing lib/libcurl_la-pingpong.o
Removing lib/libcurl_la-pop3.lo
Removing lib/libcurl_la-pop3.o
Removing lib/libcurl_la-progress.lo
Removing lib/libcurl_la-progress.o
Removing lib/libcurl_la-psl.lo
Removing lib/libcurl_la-psl.o
Removing lib/libcurl_la-rand.lo
Removing lib/libcurl_la-rand.o
Removing lib/libcurl_la-rename.lo
Removing lib/libcurl_la-rename.o
Removing lib/libcurl_la-rtsp.lo
Removing lib/libcurl_la-rtsp.o
Removing lib/libcurl_la-select.lo
Removing lib/libcurl_la-select.o
Removing lib/libcurl_la-sendf.lo
Removing lib/libcurl_la-sendf.o
Removing lib/libcurl_la-setopt.lo
Removing lib/libcurl_la-setopt.o
Removing lib/libcurl_la-sha256.lo
Removing lib/libcurl_la-sha256.o
Removing lib/libcurl_la-share.lo
Removing lib/libcurl_la-share.o
Removing lib/libcurl_la-slist.lo
Removing lib/libcurl_la-slist.o
Removing lib/libcurl_la-smb.lo
Removing lib/libcurl_la-smb.o
Removing lib/libcurl_la-smtp.lo
Removing lib/libcurl_la-smtp.o
Removing lib/libcurl_la-socketpair.lo
Removing lib/libcurl_la-socketpair.o
Removing lib/libcurl_la-socks.lo
Removing lib/libcurl_la-socks.o
Removing lib/libcurl_la-socks_gssapi.lo
Removing lib/libcurl_la-socks_gssapi.o
Removing lib/libcurl_la-socks_sspi.lo
Removing lib/libcurl_la-socks_sspi.o
Removing lib/libcurl_la-speedcheck.lo
Removing lib/libcurl_la-speedcheck.o
Removing lib/libcurl_la-splay.lo
Removing lib/libcurl_la-splay.o
Removing lib/libcurl_la-strcase.lo
Removing lib/libcurl_la-strcase.o
Removing lib/libcurl_la-strdup.lo
Removing lib/libcurl_la-strdup.o
Removing lib/libcurl_la-strerror.lo
Removing lib/libcurl_la-strerror.o
Removing lib/libcurl_la-strtok.lo
Removing lib/libcurl_la-strtok.o
Removing lib/libcurl_la-strtoofft.lo
Removing lib/libcurl_la-strtoofft.o
Removing lib/libcurl_la-system_win32.lo
Removing lib/libcurl_la-system_win32.o
Removing lib/libcurl_la-telnet.lo
Removing lib/libcurl_la-telnet.o
Removing lib/libcurl_la-tftp.lo
Removing lib/libcurl_la-tftp.o
Removing lib/libcurl_la-timediff.lo
Removing lib/libcurl_la-timediff.o
Removing lib/libcurl_la-timeval.lo
Removing lib/libcurl_la-timeval.o
Removing lib/libcurl_la-transfer.lo
Removing lib/libcurl_la-transfer.o
Removing lib/libcurl_la-url.lo
Removing lib/libcurl_la-url.o
Removing lib/libcurl_la-urlapi.lo
Removing lib/libcurl_la-urlapi.o
Removing lib/libcurl_la-version.lo
Removing lib/libcurl_la-version.o
Removing lib/libcurl_la-version_win32.lo
Removing lib/libcurl_la-version_win32.o
Removing lib/libcurl_la-warnless.lo
Removing lib/libcurl_la-warnless.o
Removing lib/libcurl_la-ws.lo
Removing lib/libcurl_la-ws.o
Removing lib/nonblock.o
Removing lib/stamp-h1
Removing lib/strtoofft.o
Removing lib/timediff.o
Removing lib/vauth/.deps/
Removing lib/vauth/.dirstamp
Removing lib/vauth/libcurl_la-cleartext.lo
Removing lib/vauth/libcurl_la-cleartext.o
Removing lib/vauth/libcurl_la-cram.lo
Removing lib/vauth/libcurl_la-cram.o
Removing lib/vauth/libcurl_la-digest.lo
Removing lib/vauth/libcurl_la-digest.o
Removing lib/vauth/libcurl_la-digest_sspi.lo
Removing lib/vauth/libcurl_la-digest_sspi.o
Removing lib/vauth/libcurl_la-gsasl.lo
Removing lib/vauth/libcurl_la-gsasl.o
Removing lib/vauth/libcurl_la-krb5_gssapi.lo
Removing lib/vauth/libcurl_la-krb5_gssapi.o
Removing lib/vauth/libcurl_la-krb5_sspi.lo
Removing lib/vauth/libcurl_la-krb5_sspi.o
Removing lib/vauth/libcurl_la-ntlm.lo
Removing lib/vauth/libcurl_la-ntlm.o
Removing lib/vauth/libcurl_la-ntlm_sspi.lo
Removing lib/vauth/libcurl_la-ntlm_sspi.o
Removing lib/vauth/libcurl_la-oauth2.lo
Removing lib/vauth/libcurl_la-oauth2.o
Removing lib/vauth/libcurl_la-spnego_gssapi.lo
Removing lib/vauth/libcurl_la-spnego_gssapi.o
Removing lib/vauth/libcurl_la-spnego_sspi.lo
Removing lib/vauth/libcurl_la-spnego_sspi.o
Removing lib/vauth/libcurl_la-vauth.lo
Removing lib/vauth/libcurl_la-vauth.o
Removing lib/version_win32.o
Removing lib/vquic/.deps/
Removing lib/vquic/.dirstamp
Removing lib/vquic/libcurl_la-curl_msh3.lo
Removing lib/vquic/libcurl_la-curl_msh3.o
Removing lib/vquic/libcurl_la-curl_ngtcp2.lo
Removing lib/vquic/libcurl_la-curl_ngtcp2.o
Removing lib/vquic/libcurl_la-curl_quiche.lo
Removing lib/vquic/libcurl_la-curl_quiche.o
Removing lib/vquic/libcurl_la-vquic.lo
Removing lib/vquic/libcurl_la-vquic.o
Removing lib/vssh/.deps/
Removing lib/vssh/.dirstamp
Removing lib/vssh/libcurl_la-libssh.lo
Removing lib/vssh/libcurl_la-libssh.o
Removing lib/vssh/libcurl_la-libssh2.lo
Removing lib/vssh/libcurl_la-libssh2.o
Removing lib/vssh/libcurl_la-wolfssh.lo
Removing lib/vssh/libcurl_la-wolfssh.o
Removing lib/vtls/.deps/
Removing lib/vtls/.dirstamp
Removing lib/vtls/libcurl_la-bearssl.lo
Removing lib/vtls/libcurl_la-bearssl.o
Removing lib/vtls/libcurl_la-gtls.lo
Removing lib/vtls/libcurl_la-gtls.o
Removing lib/vtls/libcurl_la-hostcheck.lo
Removing lib/vtls/libcurl_la-hostcheck.o
Removing lib/vtls/libcurl_la-keylog.lo
Removing lib/vtls/libcurl_la-keylog.o
Removing lib/vtls/libcurl_la-mbedtls.lo
Removing lib/vtls/libcurl_la-mbedtls.o
Removing lib/vtls/libcurl_la-mbedtls_threadlock.lo
Removing lib/vtls/libcurl_la-mbedtls_threadlock.o
Removing lib/vtls/libcurl_la-openssl.lo
Removing lib/vtls/libcurl_la-openssl.o
Removing lib/vtls/libcurl_la-rustls.lo
Removing lib/vtls/libcurl_la-rustls.o
Removing lib/vtls/libcurl_la-schannel.lo
Removing lib/vtls/libcurl_la-schannel.o
Removing lib/vtls/libcurl_la-schannel_verify.lo
Removing lib/vtls/libcurl_la-schannel_verify.o
Removing lib/vtls/libcurl_la-sectransp.lo
Removing lib/vtls/libcurl_la-sectransp.o
Removing lib/vtls/libcurl_la-vtls.lo
Removing lib/vtls/libcurl_la-vtls.o
Removing lib/vtls/libcurl_la-wolfssl.lo
Removing lib/vtls/libcurl_la-wolfssl.o
Removing lib/vtls/libcurl_la-x509asn1.lo
Removing lib/vtls/libcurl_la-x509asn1.o
Removing lib/warnless.o
Removing libcurl.pc
Removing libtool
Removing ltmain.sh
Removing m4/libtool.m4
Removing m4/ltoptions.m4
Removing m4/ltsugar.m4
Removing m4/ltversion.m4
Removing m4/lt~obsolete.m4
Removing missing
Removing packages/Makefile
Removing packages/Makefile.in
Removing packages/vms/Makefile
Removing packages/vms/Makefile.in
Removing scripts/Makefile
Removing scripts/Makefile.in
Removing src/.deps/
Removing src/.libs/
Removing src/Makefile
Removing src/Makefile.in
Removing src/curl
Removing src/slist_wc.o
Removing src/tool_binmode.o
Removing src/tool_bname.o
Removing src/tool_cb_dbg.o
Removing src/tool_cb_hdr.o
Removing src/tool_cb_prg.o
Removing src/tool_cb_rea.o
Removing src/tool_cb_see.o
Removing src/tool_cb_wrt.o
Removing src/tool_cfgable.o
Removing src/tool_dirhie.o
Removing src/tool_doswin.o
Removing src/tool_easysrc.o
Removing src/tool_filetime.o
Removing src/tool_findfile.o
Removing src/tool_formparse.o
Removing src/tool_getparam.o
Removing src/tool_getpass.o
Removing src/tool_help.o
Removing src/tool_helpers.o
Removing src/tool_hugehelp.c
Removing src/tool_hugehelp.o
Removing src/tool_ipfs.o
Removing src/tool_libinfo.o
Removing src/tool_listhelp.o
Removing src/tool_main.o
Removing src/tool_msgs.o
Removing src/tool_operate.o
Removing src/tool_operhlp.o
Removing src/tool_paramhlp.o
Removing src/tool_parsecfg.o
Removing src/tool_progress.o
Removing src/tool_setopt.o
Removing src/tool_sleep.o
Removing src/tool_stderr.o
Removing src/tool_strdup.o
Removing src/tool_urlglob.o
Removing src/tool_util.o
Removing src/tool_vms.o
Removing src/tool_writeout.o
Removing src/tool_writeout_json.o
Removing src/tool_xattr.o
Removing src/var.o
Removing test-driver
Removing tests/Makefile
Removing tests/Makefile.in
Removing tests/certs/Makefile
Removing tests/certs/Makefile.in
Removing tests/certs/scripts/Makefile
Removing tests/certs/scripts/Makefile.in
Removing tests/config
Removing tests/configurehelp.pm
Removing tests/data/Makefile
Removing tests/data/Makefile.in
Removing tests/http/Makefile
Removing tests/http/Makefile.in
Removing tests/http/clients/.deps/
Removing tests/http/clients/Makefile
Removing tests/http/clients/Makefile.in
Removing tests/http/config.ini
Removing tests/libtest/.deps/
Removing tests/libtest/Makefile
Removing tests/libtest/Makefile.in
Removing tests/server/.deps/
Removing tests/server/Makefile
Removing tests/server/Makefile.in
Removing tests/unit/.deps/
Removing tests/unit/Makefile
Removing tests/unit/Makefile.in
$ autoreconf -fi
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
libtoolize: Remember to add 'LT_INIT' to configure.ac.
configure.ac:123: installing './compile'
configure.ac:424: installing './config.guess'
configure.ac:424: installing './config.sub'
configure.ac:123: installing './install-sh'
configure.ac:129: installing './missing'
docs/examples/Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
$ bash -c find . -name config.guess -exec cp /usr/share/misc/config.guess {} \;
$ bash -c find . -name config.sub -exec cp /usr/share/misc/config.sub {} \;
$ chmod +x configure
$ ./configure --disable-shared --without-ssl --disable-docs
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... (assumed) yes
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable curl debug memory tracking... no
checking whether to enable hiding of library internal symbols... yes
checking whether to enable c-ares for DNS lookups... no
checking whether to disable dependency on -lrt... (assumed no)
checking whether to enable ECH support... no
checking for path separator... :
checking for sed... /usr/bin/sed
checking for grep... /usr/bin/grep
checking that grep -E works... yes
checking for ar... /usr/bin/ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... ccache gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether ccache gcc accepts -g... yes
checking for ccache gcc option to enable C11 features... none needed
checking whether ccache gcc understands -c and -o together... yes
checking how to run the C preprocessor... ccache gcc -E
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for stdatomic.h... yes
checking if _Atomic is available... yes
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for code coverage support... no
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of ccache gcc... gcc3
checking curl version... 8.5.1-DEV
checking for httpd... no
checking for apache2... no
checking for apachectl... no
checking for apxs... no
configure: httpd/apache2 not in PATH, http tests disabled
configure: apxs not in PATH, http tests disabled
checking for nghttpx... no
checking for caddy... no
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking if OS is AIX (to define _ALL_SOURCE)... no
checking if _THREAD_SAFE is already defined... no
checking if _THREAD_SAFE is actually needed... no
checking if _THREAD_SAFE is onwards defined... no
checking if _REENTRANT is already defined... no
checking if _REENTRANT is actually needed... no
checking if _REENTRANT is onwards defined... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by ccache gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from ccache gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if ccache gcc supports -fno-rtti -fno-exceptions... no
checking for ccache gcc option to produce PIC... -fPIC -DPIC
checking if ccache gcc PIC flag -fPIC -DPIC works... yes
checking if ccache gcc static flag -static works... yes
checking if ccache gcc supports -c -o file.o... yes
checking if ccache gcc supports -c -o file.o... (cached) yes
checking whether the ccache gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether to build shared libraries with -version-info... yes
checking whether to build shared libraries with -no-undefined... no
checking whether to build shared libraries with -mimpure-text... no
checking whether to build shared libraries with PIC... yes
checking whether to build static libraries with PIC... yes
checking whether to build shared libraries only... no
checking whether to build static libraries only... yes
checking for windres... no
checking for inline... inline
checking if cpp -P is needed... yes
checking if cpp -P works... yes
checking if compiler is DEC/Compaq/HP C... no
checking if compiler is HP-UX C... no
checking if compiler is IBM C... no
checking if compiler is Intel C... no
checking if compiler is clang... no
checking if compiler is GNU C... yes
checking compiler version... gcc '1100' (raw: '11')
checking if compiler is SGI MIPSpro C... no
checking if compiler is SGI MIPS C... no
checking if compiler is SunPro C... no
checking if compiler is Tiny C... no
checking if compiler accepts some basic options... yes
configure: compiler options added: -Werror-implicit-function-declaration
checking if compiler optimizer assumed setting might be used... yes
checking if compiler accepts optimizer enabling options... yes
configure: compiler options added: -O2
checking if compiler accepts strict warning options... yes
configure: compiler options added: -Wno-system-headers
checking if compiler halts on compilation errors... yes
checking if compiler halts on negative sized arrays... yes
checking if compiler halts on function prototype mismatch... yes
checking if compiler supports hiding library internal symbols... yes
checking for windows.h... no
checking whether build target is a native Windows one... no
checking whether build target supports WIN32 file API... no
checking whether build target supports WIN32 crypto API... no
checking for good-to-use Darwin CFLAGS... no
checking whether to link macOS CoreFoundation, CoreServices, and SystemConfiguration frameworks... no
checking to see if the compiler supports __builtin_available()... no
checking whether to support http... yes
checking whether to support ftp... yes
checking whether to support file... yes
checking whether to support ldap... yes
checking whether to support ldaps... yes
checking whether to support rtsp... yes
checking whether to support proxies... yes
checking whether to support dict... yes
checking whether to support telnet... yes
checking whether to support tftp... yes
checking whether to support pop3... yes
checking whether to support imap... yes
checking whether to support smb... yes
checking whether to support smtp... yes
checking whether to support gopher... yes
checking whether to support mqtt... no
checking whether to provide built-in manual... yes
checking whether to enable generation of C code... yes
checking whether to use libgcc... no
checking if X/Open network library is required... no
checking for gethostbyname... yes
checking for windows.h... (cached) no
checking for winsock2.h... (cached) no
checking for proto/bsdsocket.h... no
checking for connect in libraries... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... yes
checking for monotonic clock_gettime... yes
checking for clock_gettime in libraries... no additional lib required
checking if monotonic clock_gettime works... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for raw monotonic clock_gettime... yes
checking for pkg-config... /usr/bin/pkg-config
checking for zlib options with pkg-config... found
checking for zlib.h... yes
configure: found both libz and libz.h header
checking for BrotliDecoderDecompress in -lbrotlidec... no
checking for brotli/decode.h... no
checking for ZSTD_createDStream in -lzstd... no
checking for zstd.h... no
checking for lber.h... no
checking for ldap.h... no
checking for ldap_ssl.h... no
checking for LDAP libraries... cannot find LDAP libraries
checking whether to enable IPv6... yes
checking if struct sockaddr_in6 has sin6_scope_id member... yes
checking if argv can be written to... yes
checking if GSS-API support is requested... no
checking whether to enable Windows native SSL/TLS... no
checking whether to enable Secure Transport... no
checking whether to enable Amiga native SSL/TLS (AmiSSL v5)... no
checking for library containing psl_builtin... -lpsl
checking for library containing gsasl_init... no
checking for RTMP_Init in -lrtmp... no
checking whether versioned symbols are wanted... no
checking whether to enable Windows native IDN (Windows native builds only)... no
checking whether to build with libidn2... (assumed) yes
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libidn2 options with pkg-config... no
configure: IDN_LIBS: "-lidn2"
configure: IDN_LDFLAGS: ""
configure: IDN_CPPFLAGS: ""
configure: IDN_DIR: ""
checking if idn2_lookup_ul can be linked... no
checking for idn2.h... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libnghttp2 options with pkg-config... no
checking for nghttp2_session_get_stream_local_window_size in -lnghttp2... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for fish options with pkg-config... no
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for sys/select.h... yes
checking for sys/socket.h... yes
checking for sys/ioctl.h... yes
checking for unistd.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for arpa/inet.h... yes
checking for net/if.h... yes
checking for netinet/in.h... yes
checking for netinet/in6.h... no
checking for sys/un.h... yes
checking for linux/tcp.h... yes
checking for netinet/tcp.h... yes
checking for netinet/udp.h... yes
checking for netdb.h... yes
checking for sys/sockio.h... no
checking for sys/stat.h... (cached) yes
checking for sys/param.h... yes
checking for termios.h... yes
checking for termio.h... yes
checking for fcntl.h... yes
checking for io.h... no
checking for pwd.h... yes
checking for utime.h... yes
checking for sys/utime.h... no
checking for sys/poll.h... yes
checking for poll.h... yes
checking for socket.h... no
checking for sys/resource.h... yes
checking for libgen.h... yes
checking for locale.h... yes
checking for stdbool.h... yes
checking for sys/filio.h... no
checking for sys/wait.h... yes
checking for setjmp.h... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for struct timeval... yes
checking run-time libs availability... fine
checking size of size_t... 8
checking size of long... 8
checking size of int... 4
checking size of time_t... 8
checking size of off_t... 8
checking size of curl_off_t... 8
checking size of curl_socket_t... 4
checking for long long... yes
checking for ssize_t... yes
checking for bool... yes
checking for sa_family_t... yes
checking for suseconds_t... yes
checking if time_t is unsigned... no
checking for sys/types.h... (cached) yes
checking for poll.h... (cached) yes
checking for sys/poll.h... (cached) yes
checking for in_addr_t... yes
checking for struct sockaddr_storage... yes
checking for sys/select.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for select... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for recv... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for send... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for MSG_NOSIGNAL... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking if alarm can be linked... yes
checking if alarm is prototyped... yes
checking if alarm is compilable... yes
checking if alarm usage allowed... yes
checking if alarm might be used... yes
checking for sys/types.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for libgen.h... (cached) yes
checking if basename can be linked... yes
checking if basename is prototyped... yes
checking if basename is compilable... yes
checking if basename usage allowed... yes
checking if basename might be used... yes
checking for sys/types.h... (cached) yes
checking for socket.h... (cached) no
checking if closesocket can be linked... no
checking if closesocket might be used... no
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking if CloseSocket can be linked... no
checking if CloseSocket might be used... no
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for fcntl.h... (cached) yes
checking if fcntl can be linked... yes
checking if fcntl is prototyped... yes
checking if fcntl is compilable... yes
checking if fcntl usage allowed... yes
checking if fcntl might be used... yes
checking if fcntl O_NONBLOCK is compilable... yes
checking if fcntl O_NONBLOCK usage allowed... yes
checking if fcntl O_NONBLOCK might be used... yes
checking for windows.h... (cached) no
checking for winsock2.h... (cached) no
checking for ws2tcpip.h... (cached) no
checking for sys/types.h... (cached) yes
checking for netdb.h... (cached) yes
checking if freeaddrinfo can be linked... yes
checking if freeaddrinfo is prototyped... yes
checking if freeaddrinfo is compilable... yes
checking if freeaddrinfo usage allowed... yes
checking if freeaddrinfo might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/xattr.h... yes
checking if fsetxattr can be linked... yes
checking if fsetxattr is prototyped... yes
checking if fsetxattr takes 5 args.... yes
checking if fsetxattr is compilable... yes
checking if fsetxattr usage allowed... yes
checking if fsetxattr might be used... yes
checking if ftruncate can be linked... yes
checking if ftruncate is prototyped... yes
checking if ftruncate is compilable... yes
checking if ftruncate usage allowed... yes
checking if ftruncate might be used... yes
checking for sys/types.h... (cached) yes
checking if getaddrinfo can be linked... yes
checking if getaddrinfo is prototyped... yes
checking if getaddrinfo is compilable... yes
checking if getaddrinfo seems to work... yes
checking if getaddrinfo usage allowed... yes
checking if getaddrinfo might be used... yes
checking if getaddrinfo is threadsafe... yes
checking if gethostbyname can be linked... yes
checking if gethostbyname is prototyped... yes
checking if gethostbyname is compilable... yes
checking if gethostbyname usage allowed... yes
checking if gethostbyname might be used... yes
checking if gethostbyname_r can be linked... yes
checking if gethostbyname_r is prototyped... yes
checking if gethostbyname_r takes 3 args.... no
checking if gethostbyname_r takes 5 args.... no
checking if gethostbyname_r takes 6 args.... yes
checking if gethostbyname_r is compilable... yes
checking if gethostbyname_r usage allowed... yes
checking if gethostbyname_r might be used... yes
checking if gethostname can be linked... yes
checking if gethostname is prototyped... yes
checking if gethostname is compilable... yes
checking for gethostname arg 2 data type... size_t
checking if gethostname usage allowed... yes
checking if gethostname might be used... yes
checking if getpeername can be linked... yes
checking if getpeername is prototyped... yes
checking if getpeername is compilable... yes
checking if getpeername usage allowed... yes
checking if getpeername might be used... yes
checking if getsockname can be linked... yes
checking if getsockname is prototyped... yes
checking if getsockname is compilable... yes
checking if getsockname usage allowed... yes
checking if getsockname might be used... yes
checking for net/if.h... (cached) yes
checking if if_nametoindex can be linked... yes
checking if if_nametoindex is prototyped... yes
checking if if_nametoindex is compilable... yes
checking if if_nametoindex usage allowed... yes
checking if if_nametoindex might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for ifaddrs.h... yes
checking if getifaddrs can be linked... yes
checking if getifaddrs is prototyped... yes
checking if getifaddrs is compilable... yes
checking if getifaddrs seems to work... yes
checking if getifaddrs usage allowed... yes
checking if getifaddrs might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking if gmtime_r can be linked... yes
checking if gmtime_r is prototyped... yes
checking if gmtime_r is compilable... yes
checking if gmtime_r seems to work... yes
checking if gmtime_r usage allowed... yes
checking if gmtime_r might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for arpa/inet.h... (cached) yes
checking if inet_ntop can be linked... yes
checking if inet_ntop is prototyped... yes
checking if inet_ntop is compilable... yes
checking if inet_ntop seems to work... yes
checking if inet_ntop usage allowed... yes
checking if inet_ntop might be used... yes
checking if inet_pton can be linked... yes
checking if inet_pton is prototyped... yes
checking if inet_pton is compilable... yes
checking if inet_pton seems to work... yes
checking if inet_pton usage allowed... yes
checking if inet_pton might be used... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for sys/ioctl.h... (cached) yes
checking for stropts.h... no
checking if ioctl can be linked... yes
checking if ioctl is prototyped... yes
checking if ioctl is compilable... yes
checking if ioctl usage allowed... yes
checking if ioctl might be used... yes
checking if ioctl FIONBIO is compilable... yes
checking if ioctl FIONBIO usage allowed... yes
checking if ioctl FIONBIO might be used... yes
checking if ioctl SIOCGIFADDR is compilable... yes
checking if ioctl SIOCGIFADDR usage allowed... yes
checking if ioctl SIOCGIFADDR might be used... yes
checking if ioctlsocket can be linked... no
checking if ioctlsocket might be used... no
checking if IoctlSocket can be linked... no
checking if IoctlSocket might be used... no
checking if memrchr can be linked... yes
checking if memrchr is prototyped... no
checking if memrchr might be used... no
checking if poll can be linked... yes
checking if poll is prototyped... yes
checking if poll is compilable... yes
checking if poll seems to work... yes
checking if poll usage allowed... yes
checking if poll might be used... yes
checking for sys/types.h... (cached) yes
checking if sigaction can be linked... yes
checking if sigaction is prototyped... yes
checking if sigaction is compilable... yes
checking if sigaction usage allowed... yes
checking if sigaction might be used... yes
checking if siginterrupt can be linked... yes
checking if siginterrupt is prototyped... yes
checking if siginterrupt is compilable... yes
checking if siginterrupt usage allowed... yes
checking if siginterrupt might be used... yes
checking if signal can be linked... yes
checking if signal is prototyped... yes
checking if signal is compilable... yes
checking if signal usage allowed... yes
checking if signal might be used... yes
checking for sys/types.h... (cached) yes
checking if sigsetjmp can be linked... no
checking if sigsetjmp seems a macro... yes
checking if sigsetjmp is compilable... yes
checking if sigsetjmp usage allowed... yes
checking if sigsetjmp might be used... yes
checking if socket can be linked... yes
checking if socket is prototyped... yes
checking if socket is compilable... yes
checking if socket usage allowed... yes
checking if socket might be used... yes
checking if socketpair can be linked... yes
checking if socketpair is prototyped... yes
checking if socketpair is compilable... yes
checking if socketpair usage allowed... yes
checking if socketpair might be used... yes
checking if strcasecmp can be linked... yes
checking if strcasecmp is prototyped... yes
checking if strcasecmp is compilable... yes
checking if strcasecmp usage allowed... yes
checking if strcasecmp might be used... yes
checking if strcmpi can be linked... no
checking if strcmpi might be used... no
checking if strdup can be linked... yes
checking if strdup is prototyped... yes
checking if strdup is compilable... yes
checking if strdup usage allowed... yes
checking if strdup might be used... yes
checking if strerror_r can be linked... yes
checking if strerror_r is prototyped... yes
checking if strerror_r is compilable... yes
checking if strerror_r is glibc like... no
checking if strerror_r is POSIX like... yes
checking if strerror_r seems to work... yes
checking if strerror_r usage allowed... yes
checking if strerror_r might be used... yes
checking if stricmp can be linked... no
checking if stricmp might be used... no
checking if strtok_r can be linked... yes
checking if strtok_r is prototyped... yes
checking if strtok_r is compilable... yes
checking if strtok_r usage allowed... yes
checking if strtok_r might be used... yes
checking if strtoll can be linked... yes
checking if strtoll is prototyped... yes
checking if strtoll is compilable... yes
checking if strtoll usage allowed... yes
checking if strtoll might be used... yes
checking for ccache gcc options needed to detect all undeclared functions... none needed
checking whether getpwuid_r is declared... yes
checking for _fseeki64... no
checking deeper for _fseeki64... but still no
checking for arc4random... no
checking deeper for arc4random... but still no
checking for fnmatch... yes
checking for fseeko... yes
checking for geteuid... yes
checking for getpass_r... no
checking deeper for getpass_r... but still no
checking for getppid... yes
checking for getpwuid... yes
checking for getpwuid_r... yes
checking for getrlimit... yes
checking for gettimeofday... yes
checking for if_nametoindex... yes
checking for mach_absolute_time... no
checking deeper for mach_absolute_time... but still no
checking for pipe... yes
checking for sched_yield... yes
checking for sendmsg... yes
checking for setlocale... yes
checking for setmode... no
checking deeper for setmode... but still no
checking for setrlimit... yes
checking for snprintf... yes
checking for utime... yes
checking for utimes... yes
checking whether fseeko is declared... yes
checking how to set a socket into non-blocking mode... fcntl O_NONBLOCK
checking for perl... /usr/bin/perl
checking for gnroff... no
checking for nroff... /usr/bin/nroff
checking how to use *nroff to get plain text from man pages... -man
checking whether to enable the threaded resolver... yes
checking whether to use POSIX threads for threaded resolver... auto
checking for pthread.h... yes
checking for pthread_create... yes
checking convert -I options to -isystem... yes
checking whether to enable verbose strings... yes
checking whether to enable SSPI support (Windows native builds only)... no
checking whether to enable basic authentication method... yes
checking whether to enable bearer authentication method... yes
checking whether to enable digest authentication method... yes
checking whether to enable kerberos authentication method... yes
checking whether to enable negotiate authentication method... yes
checking whether to enable aws sig methods... yes
checking whether to support NTLM... yes
checking whether to enable NTLM delegation to winbind's helper... no
checking whether to enable TLS-SRP authentication... yes
checking whether to enable Unix domain sockets... auto
checking for struct sockaddr_un.sun_path... yes
checking whether to support cookies... yes
checking whether to support socketpair... yes
checking whether to support HTTP authentication... yes
checking whether to support DoH... yes
checking whether to support the MIME API... yes
checking whether to support binding connections locally... yes
checking whether to support the form API... yes
checking whether to support date parsing... yes
checking whether to support netrc parsing... yes
checking whether to support progress-meter... yes
checking whether to support DNS shuffling... yes
checking whether to support curl_easy_option*... yes
checking whether to support alt-svc... yes
checking whether to support headers-api... yes
configure: disables HSTS due to lack of SSL
checking whether to support WebSockets... no
checking whether hiding of library internal symbols will actually happen... yes
checking if this build supports HTTPS-proxy... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating docs/Makefile
config.status: creating docs/examples/Makefile
config.status: creating docs/libcurl/Makefile
config.status: creating docs/libcurl/opts/Makefile
config.status: creating docs/cmdline-opts/Makefile
config.status: creating include/Makefile
config.status: creating include/curl/Makefile
config.status: creating src/Makefile
config.status: creating lib/Makefile
config.status: creating scripts/Makefile
config.status: creating lib/libcurl.vers
config.status: creating lib/libcurl.plist
config.status: creating tests/Makefile
config.status: creating tests/config
config.status: creating tests/certs/Makefile
config.status: creating tests/certs/scripts/Makefile
config.status: creating tests/data/Makefile
config.status: creating tests/server/Makefile
config.status: creating tests/libtest/Makefile
config.status: creating tests/unit/Makefile
config.status: creating tests/http/config.ini
config.status: creating tests/http/Makefile
config.status: creating tests/http/clients/Makefile
config.status: creating packages/Makefile
config.status: creating packages/vms/Makefile
config.status: creating curl-config
config.status: creating libcurl.pc
config.status: creating lib/curl_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure: Configured to build curl/libcurl:
Host setup: x86_64-pc-linux-gnu
Install prefix: /usr/local
Compiler: ccache gcc
CFLAGS: -Werror-implicit-function-declaration -O2 -Wno-system-headers
CPPFLAGS:
LDFLAGS:
LIBS: -lpsl -lz
curl version: 8.5.1-DEV
SSL: no (--with-{openssl,gnutls,mbedtls,wolfssl,schannel,secure-transport,amissl,bearssl,rustls} )
SSH: no (--with-{libssh,libssh2})
zlib: enabled
brotli: no (--with-brotli)
zstd: no (--with-zstd)
GSS-API: no (--with-gssapi)
GSASL: no (libgsasl not found)
TLS-SRP: no (--enable-tls-srp)
resolver: POSIX threaded
IPv6: enabled
Unix sockets: enabled
IDN: no (--with-{libidn2,winidn})
Build libcurl: Shared=no, Static=yes
Built-in manual: enabled
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors: enabled (--disable-verbose)
Code coverage: disabled
SSPI: no (--enable-sspi)
ca cert bundle: no
ca cert path:
ca fallback:
LDAP: no (--enable-ldap / --with-ldap-lib / --with-lber-lib)
LDAPS: no (--enable-ldaps)
RTSP: enabled
RTMP: no (--with-librtmp)
PSL: enabled
Alt-svc: enabled (--disable-alt-svc)
Headers API: enabled (--disable-headers-api)
HSTS: no (--enable-hsts)
HTTP1: enabled (internal)
HTTP2: no (--with-nghttp2)
HTTP3: no (--with-ngtcp2 --with-nghttp3, --with-quiche, --with-msh3)
ECH: no (--enable-ech)
WebSockets: no (--enable-websockets)
Protocols: DICT FILE FTP GOPHER HTTP IMAP IPFS IPNS MQTT POP3 RTSP SMTP TELNET TFTP
Features: AsynchDNS IPv6 Largefile PSL UnixSockets alt-svc libz threadsafe
configure: WARNING: unrecognized options: --disable-docs
configure: WARNING: Cannot find libraries for LDAP support: LDAP disabled
configure: WARNING: libgsasl was not found
configure: WARNING: Cannot find libraries for IDN support: IDN disabled
configure: WARNING: unrecognized options: --disable-docs
$ make -j3
Making all in lib
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
make all-am
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
CC libcurl_la-amigaos.lo
CC libcurl_la-altsvc.lo
CC libcurl_la-asyn-ares.lo
CC libcurl_la-asyn-thread.lo
CC libcurl_la-base64.lo
CC libcurl_la-bufq.lo
CC libcurl_la-bufref.lo
CC libcurl_la-c-hyper.lo
CC libcurl_la-cf-h1-proxy.lo
CC libcurl_la-cf-h2-proxy.lo
CC libcurl_la-cf-haproxy.lo
CC libcurl_la-cf-https-connect.lo
CC libcurl_la-cf-socket.lo
CC libcurl_la-cfilters.lo
CC libcurl_la-conncache.lo
CC libcurl_la-connect.lo
CC libcurl_la-content_encoding.lo
CC libcurl_la-cookie.lo
CC libcurl_la-curl_addrinfo.lo
CC libcurl_la-curl_des.lo
CC libcurl_la-curl_endian.lo
CC libcurl_la-curl_fnmatch.lo
CC libcurl_la-curl_get_line.lo
CC libcurl_la-curl_gethostname.lo
CC libcurl_la-curl_gssapi.lo
CC libcurl_la-curl_memrchr.lo
CC libcurl_la-curl_multibyte.lo
CC libcurl_la-curl_ntlm_core.lo
CC libcurl_la-curl_ntlm_wb.lo
CC libcurl_la-curl_path.lo
CC libcurl_la-curl_range.lo
CC libcurl_la-curl_rtmp.lo
CC libcurl_la-curl_sasl.lo
CC libcurl_la-curl_sspi.lo
CC libcurl_la-curl_threads.lo
CC libcurl_la-curl_trc.lo
CC libcurl_la-dict.lo
CC libcurl_la-doh.lo
CC libcurl_la-dynbuf.lo
CC libcurl_la-dynhds.lo
CC libcurl_la-easy.lo
CC libcurl_la-easygetopt.lo
CC libcurl_la-easyoptions.lo
CC libcurl_la-escape.lo
CC libcurl_la-file.lo
CC libcurl_la-fileinfo.lo
CC libcurl_la-fopen.lo
CC libcurl_la-formdata.lo
CC libcurl_la-ftp.lo
CC libcurl_la-ftplistparser.lo
CC libcurl_la-getenv.lo
CC libcurl_la-getinfo.lo
CC libcurl_la-gopher.lo
CC libcurl_la-hash.lo
CC libcurl_la-headers.lo
CC libcurl_la-hmac.lo
CC libcurl_la-hostasyn.lo
CC libcurl_la-hostip.lo
CC libcurl_la-hostip4.lo
CC libcurl_la-hostip6.lo
CC libcurl_la-hostsyn.lo
CC libcurl_la-hsts.lo
CC libcurl_la-http.lo
CC libcurl_la-http1.lo
CC libcurl_la-http2.lo
CC libcurl_la-http_aws_sigv4.lo
CC libcurl_la-http_chunks.lo
CC libcurl_la-http_digest.lo
CC libcurl_la-http_negotiate.lo
CC libcurl_la-http_ntlm.lo
CC libcurl_la-http_proxy.lo
CC libcurl_la-idn.lo
CC libcurl_la-if2ip.lo
CC libcurl_la-imap.lo
CC libcurl_la-inet_ntop.lo
CC libcurl_la-inet_pton.lo
CC libcurl_la-krb5.lo
CC libcurl_la-ldap.lo
CC libcurl_la-llist.lo
CC libcurl_la-macos.lo
CC libcurl_la-md4.lo
CC libcurl_la-md5.lo
CC libcurl_la-memdebug.lo
CC libcurl_la-mime.lo
CC libcurl_la-mprintf.lo
CC libcurl_la-mqtt.lo
CC libcurl_la-multi.lo
CC libcurl_la-netrc.lo
CC libcurl_la-nonblock.lo
CC libcurl_la-noproxy.lo
CC libcurl_la-openldap.lo
CC libcurl_la-parsedate.lo
CC libcurl_la-pingpong.lo
CC libcurl_la-pop3.lo
CC libcurl_la-progress.lo
CC libcurl_la-psl.lo
CC libcurl_la-rand.lo
CC libcurl_la-rename.lo
CC libcurl_la-rtsp.lo
CC libcurl_la-select.lo
CC libcurl_la-sendf.lo
CC libcurl_la-setopt.lo
CC libcurl_la-sha256.lo
CC libcurl_la-share.lo
CC libcurl_la-slist.lo
CC libcurl_la-smb.lo
CC libcurl_la-smtp.lo
CC libcurl_la-socketpair.lo
CC libcurl_la-socks.lo
CC libcurl_la-socks_gssapi.lo
CC libcurl_la-socks_sspi.lo
CC libcurl_la-speedcheck.lo
CC libcurl_la-splay.lo
CC libcurl_la-strcase.lo
CC libcurl_la-strdup.lo
CC libcurl_la-strerror.lo
CC libcurl_la-strtok.lo
CC libcurl_la-strtoofft.lo
CC libcurl_la-system_win32.lo
CC libcurl_la-telnet.lo
CC libcurl_la-tftp.lo
CC libcurl_la-timediff.lo
CC libcurl_la-timeval.lo
CC libcurl_la-transfer.lo
CC libcurl_la-url.lo
CC libcurl_la-urlapi.lo
CC libcurl_la-version.lo
CC libcurl_la-version_win32.lo
CC libcurl_la-warnless.lo
CC libcurl_la-ws.lo
CC vauth/libcurl_la-cleartext.lo
CC vauth/libcurl_la-cram.lo
CC vauth/libcurl_la-digest.lo
CC vauth/libcurl_la-digest_sspi.lo
CC vauth/libcurl_la-gsasl.lo
CC vauth/libcurl_la-krb5_gssapi.lo
CC vauth/libcurl_la-krb5_sspi.lo
CC vauth/libcurl_la-ntlm.lo
CC vauth/libcurl_la-ntlm_sspi.lo
CC vauth/libcurl_la-oauth2.lo
CC vauth/libcurl_la-spnego_gssapi.lo
CC vauth/libcurl_la-spnego_sspi.lo
CC vauth/libcurl_la-vauth.lo
CC vtls/libcurl_la-bearssl.lo
CC vtls/libcurl_la-gtls.lo
CC vtls/libcurl_la-hostcheck.lo
CC vtls/libcurl_la-keylog.lo
CC vtls/libcurl_la-mbedtls.lo
CC vtls/libcurl_la-mbedtls_threadlock.lo
CC vtls/libcurl_la-openssl.lo
CC vtls/libcurl_la-rustls.lo
CC vtls/libcurl_la-schannel.lo
CC vtls/libcurl_la-schannel_verify.lo
CC vtls/libcurl_la-sectransp.lo
CC vtls/libcurl_la-vtls.lo
CC vtls/libcurl_la-wolfssl.lo
CC vtls/libcurl_la-x509asn1.lo
CC vquic/libcurl_la-curl_msh3.lo
CC vquic/libcurl_la-curl_ngtcp2.lo
CC vquic/libcurl_la-curl_quiche.lo
CC vquic/libcurl_la-vquic.lo
CC vssh/libcurl_la-libssh.lo
CC vssh/libcurl_la-libssh2.lo
CC vssh/libcurl_la-wolfssh.lo
CCLD libcurl.la
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
Making all in src
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/src'
Making all in ../docs
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in .
make[3]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
if test "..x" != "..x" -a -e "./curl.1"; then \
/usr/bin/install -c -m 644 "./curl.1" /root/asi_db/builds/curl/_worktrees/w0/docs/curl.1 \
&& touch -r "./curl.1" /root/asi_db/builds/curl/_worktrees/w0/docs/curl.1; fi
cd cmdline-opts && make
make[4]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
GENERATE ../../docs/curl.1
make[4]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
make[3]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in cmdline-opts
make[3]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/src'
CC tool_binmode.o
CC slist_wc.o
CC tool_bname.o
CC tool_cb_dbg.o
CC tool_cb_hdr.o
CC tool_cb_prg.o
CC tool_cb_rea.o
CC tool_cb_see.o
CC tool_cb_wrt.o
CC tool_cfgable.o
CC tool_dirhie.o
CC tool_doswin.o
CC tool_easysrc.o
CC tool_filetime.o
CC tool_findfile.o
CC tool_formparse.o
CC tool_getparam.o
CC tool_getpass.o
CC tool_help.o
CC tool_helpers.o
HUGE tool_hugehelp.c
CC tool_ipfs.o
CC tool_libinfo.o
CC tool_listhelp.o
CC tool_main.o
CC tool_msgs.o
CC tool_operate.o
CC tool_operhlp.o
CC tool_paramhlp.o
CC tool_parsecfg.o
CC tool_progress.o
CC tool_setopt.o
CC tool_sleep.o
CC tool_stderr.o
CC tool_strdup.o
CC tool_urlglob.o
CC tool_util.o
CC tool_vms.o
CC tool_writeout.o
CC tool_writeout_json.o
CC tool_xattr.o
CC var.o
CC tool_hugehelp.o
CC ../lib/base64.o
CC ../lib/curl_multibyte.o
CC ../lib/dynbuf.o
CC ../lib/nonblock.o
CC ../lib/strtoofft.o
CC ../lib/timediff.o
CC ../lib/version_win32.o
CC ../lib/warnless.o
CCLD curl
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/src'
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/src'
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0'
| @@ -23,6 +23,12 @@ | |
| ########################################################################### | |
| include(CheckCCompilerFlag) | |
| + | unset(WPICKY) |
| + | |
| + | if(CURL_WERROR AND CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) |
| + | set(WPICKY "${WPICKY} -pedantic-errors") |
| + | endif() |
| + | |
| if(PICKY_COMPILER) | |
| if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") | |
| @@ -86,8 +92,10 @@ if(PICKY_COMPILER) | |
| -Wno-sign-conversion # clang 2.9 gcc 4.3 | |
| -Wno-system-headers # clang 1.0 gcc 3.0 | |
| # -Wpadded # clang 2.9 gcc 4.1 # Not used because we cannot change public structs | |
| - | -Wredundant-decls # clang 2.7 gcc 4.1 |
| -Wold-style-definition # clang 2.7 gcc 3.4 | |
| + | -Wredundant-decls # clang 2.7 gcc 4.1 |
| + | # -Wsign-conversion # clang 2.9 gcc 4.3 # FIXME |
| + | # -Wno-error=sign-conversion # FIXME |
| -Wstrict-prototypes # clang 1.0 gcc 3.3 | |
| # -Wswitch-enum # clang 2.7 gcc 4.1 # Not used because this basically disallows default case | |
| -Wtype-limits # clang 2.7 gcc 4.3 | |
| @@ -110,6 +118,7 @@ if(PICKY_COMPILER) | |
| -Wshift-sign-overflow # clang 2.9 | |
| -Wshorten-64-to-32 # clang 1.0 | |
| -Wlanguage-extension-token # clang 3.0 | |
| + | -Wformat=2 # clang 3.0 gcc 4.8 |
| ) | |
| # Enable based on compiler version | |
| if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6) OR | |
| @@ -135,6 +144,12 @@ if(PICKY_COMPILER) | |
| -Wextra-semi-stmt # clang 7.0 appleclang 10.3 | |
| ) | |
| endif() | |
| + | if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) OR |
| + | (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.4)) |
| + | list(APPEND WPICKY_ENABLE |
| + | -Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 12.4 # we have silencing markup for clang 10.0 and above only |
| + | ) |
| + | endif() |
| else() # gcc | |
| list(APPEND WPICKY_DETECT | |
| ${WPICKY_COMMON} | |
| @@ -147,6 +162,7 @@ if(PICKY_COMPILER) | |
| -Wmissing-parameter-type # gcc 4.3 | |
| -Wold-style-declaration # gcc 4.3 | |
| -Wstrict-aliasing=3 # gcc 4.0 | |
| + | -Wtrampolines # gcc 4.3 |
| ) | |
| endif() | |
| if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5 AND MINGW) | |
| @@ -156,7 +172,7 @@ if(PICKY_COMPILER) | |
| endif() | |
| if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8) | |
| list(APPEND WPICKY_ENABLE | |
| - | -Wformat=2 # clang 3.0 gcc 4.8 (clang part-default, enabling it fully causes -Wformat-nonliteral warnings) |
| + | -Wformat=2 # clang 3.0 gcc 4.8 |
| ) | |
| endif() | |
| if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) | |
| @@ -179,6 +195,7 @@ if(PICKY_COMPILER) | |
| -Wduplicated-branches # gcc 7.0 | |
| -Wformat-overflow=2 # gcc 7.0 | |
| -Wformat-truncation=2 # gcc 7.0 | |
| + | -Wimplicit-fallthrough # clang 4.0 gcc 7.0 |
| -Wrestrict # gcc 7.0 | |
| ) | |
| endif() | |
| @@ -191,8 +208,6 @@ if(PICKY_COMPILER) | |
| # | |
| - | unset(WPICKY) |
| - | |
| foreach(_CCOPT IN LISTS WPICKY_ENABLE) | |
| set(WPICKY "${WPICKY} ${_CCOPT}") | |
| endforeach() | |
| @@ -209,8 +224,10 @@ if(PICKY_COMPILER) | |
| set(WPICKY "${WPICKY} ${_CCOPT}") | |
| endif() | |
| endforeach() | |
| - | |
| - | message(STATUS "Picky compiler options:${WPICKY}") |
| - | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WPICKY}") |
| endif() | |
| endif() | |
| + | |
| + | if(WPICKY) |
| + | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WPICKY}") |
| + | message(STATUS "Picky compiler options:${WPICKY}") |
| + | endif() |
| @@ -126,15 +126,17 @@ int main(int argc, char *argv[]) | |
| default: | |
| fprintf(stderr, "\r%s: invalid parameter %s\n", | |
| appname, *argv + 3); | |
| - | exit(1); |
| + | return 1; |
| } | |
| break; | |
| } | |
| - | /* FALLTHROUGH */ |
| + | fprintf(stderr, "\r%s: invalid or unknown option %s\n", |
| + | appname, *argv); |
| + | return 1; |
| default: | |
| fprintf(stderr, "\r%s: invalid or unknown option %s\n", | |
| appname, *argv); | |
| - | exit(1); |
| + | return 1; |
| } | |
| } | |
| else { | |
| @@ -95,10 +95,7 @@ int my_trace(CURL *handle, curl_infotype type, | |
| switch(type) { | |
| case CURLINFO_TEXT: | |
| fprintf(stderr, "== Info: %s", data); | |
| - | /* FALLTHROUGH */ |
| - | default: /* in case a new one is introduced to shock us */ |
| return 0; | |
| - | |
| case CURLINFO_HEADER_OUT: | |
| text = "=> Send header"; | |
| break; | |
| @@ -117,6 +114,8 @@ int my_trace(CURL *handle, curl_infotype type, | |
| case CURLINFO_SSL_DATA_IN: | |
| text = "<= Recv SSL data"; | |
| break; | |
| + | default: /* in case a new one is introduced to shock us */ |
| + | return 0; |
| } | |
| dump(text, stderr, (unsigned char *)data, size, config->trace_ascii); | |
| @@ -115,10 +115,7 @@ int my_trace(CURL *handle, curl_infotype type, | |
| switch(type) { | |
| case CURLINFO_TEXT: | |
| fprintf(stderr, "== %u Info: %s", num, data); | |
| - | /* FALLTHROUGH */ |
| - | default: /* in case a new one is introduced to shock us */ |
| return 0; | |
| - | |
| case CURLINFO_HEADER_OUT: | |
| text = "=> Send header"; | |
| break; | |
| @@ -137,6 +134,8 @@ int my_trace(CURL *handle, curl_infotype type, | |
| case CURLINFO_SSL_DATA_IN: | |
| text = "<= Recv SSL data"; | |
| break; | |
| + | default: /* in case a new one is introduced to shock us */ |
| + | return 0; |
| } | |
| dump(text, num, (unsigned char *)data, size, 1); | |
| @@ -100,10 +100,7 @@ int my_trace(CURL *handle, curl_infotype type, | |
| switch(type) { | |
| case CURLINFO_TEXT: | |
| fprintf(stderr, "== Info: %s", data); | |
| - | /* FALLTHROUGH */ |
| - | default: /* in case a new one is introduced to shock us */ |
| return 0; | |
| - | |
| case CURLINFO_HEADER_OUT: | |
| text = "=> Send header"; | |
| break; | |
| @@ -122,6 +119,8 @@ int my_trace(CURL *handle, curl_infotype type, | |
| case CURLINFO_SSL_DATA_IN: | |
| text = "<= Recv SSL data"; | |
| break; | |
| + | default: /* in case a new one is introduced to shock us */ |
| + | return 0; |
| } | |
| dump(text, (unsigned char *)data, size, 1); | |
| @@ -133,10 +133,7 @@ int my_trace(CURL *handle, curl_infotype type, | |
| switch(type) { | |
| case CURLINFO_TEXT: | |
| fprintf(stderr, "%s [%d] Info: %s", timebuf, num, data); | |
| - | /* FALLTHROUGH */ |
| - | default: /* in case a new one is introduced to shock us */ |
| return 0; | |
| - | |
| case CURLINFO_HEADER_OUT: | |
| text = "=> Send header"; | |
| break; | |
| @@ -155,6 +152,8 @@ int my_trace(CURL *handle, curl_infotype type, | |
| case CURLINFO_SSL_DATA_IN: | |
| text = "<= Recv SSL data"; | |
| break; | |
| + | default: /* in case a new one is introduced to shock us */ |
| + | return 0; |
| } | |
| dump(text, num, (unsigned char *)data, size, 1); | |
| @@ -100,10 +100,7 @@ int my_trace(CURL *handle, curl_infotype type, | |
| switch(type) { | |
| case CURLINFO_TEXT: | |
| fprintf(stderr, "== Info: %s", data); | |
| - | /* FALLTHROUGH */ |
| - | default: /* in case a new one is introduced to shock us */ |
| return 0; | |
| - | |
| case CURLINFO_HEADER_OUT: | |
| text = "=> Send header"; | |
| break; | |
| @@ -116,6 +113,8 @@ int my_trace(CURL *handle, curl_infotype type, | |
| case CURLINFO_DATA_IN: | |
| text = "<= Recv data"; | |
| break; | |
| + | default: /* in case a new one is introduced to shock us */ |
| + | return 0; |
| } | |
| dump(text, stderr, data, size, TRUE); | |
| @@ -34,10 +34,16 @@ extern "C" { | |
| #if (defined(__GNUC__) || defined(__clang__)) && \ | |
| defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ | |
| - | !defined(__MINGW32__) && !defined(CURL_NO_FMT_CHECKS) |
| - | #define CURL_TEMP_PRINTF(a,b) __attribute__ ((format(printf, a, b))) |
| + | !defined(CURL_NO_FMT_CHECKS) |
| + | #if defined(__MINGW32__) && !defined(__clang__) |
| + | #define CURL_TEMP_PRINTF(fmt, arg) \ |
| + | __attribute__((format(gnu_printf, fmt, arg))) |
| #else | |
| - | #define CURL_TEMP_PRINTF(a,b) |
| + | #define CURL_TEMP_PRINTF(fmt, arg) \ |
| + | __attribute__((format(printf, fmt, arg))) |
| + | #endif |
| + | #else |
| + | #define CURL_TEMP_PRINTF(fmt, arg) |
| #endif | |
| CURL_EXTERN int curl_mprintf(const char *format, ...) CURL_TEMP_PRINTF(1, 2); | |
| @@ -183,7 +183,7 @@ static void h1_tunnel_go_state(struct Curl_cfilter *cf, | |
| infof(data, "CONNECT phase completed"); | |
| data->state.authproxy.done = TRUE; | |
| data->state.authproxy.multipass = FALSE; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case H1_TUNNEL_FAILED: | |
| if(new_state == H1_TUNNEL_FAILED) | |
| CURL_TRC_CF(data, cf, "new tunnel state 'failed'"); | |
| @@ -912,7 +912,7 @@ static CURLcode H1_CONNECT(struct Curl_cfilter *cf, | |
| if(result) | |
| goto out; | |
| h1_tunnel_go_state(cf, ts, H1_TUNNEL_CONNECT, data); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case H1_TUNNEL_CONNECT: | |
| /* see that the request is completely sent */ | |
| @@ -921,7 +921,7 @@ static CURLcode H1_CONNECT(struct Curl_cfilter *cf, | |
| if(result || !done) | |
| goto out; | |
| h1_tunnel_go_state(cf, ts, H1_TUNNEL_RECEIVE, data); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case H1_TUNNEL_RECEIVE: | |
| /* read what is there */ | |
| @@ -936,7 +936,7 @@ static CURLcode H1_CONNECT(struct Curl_cfilter *cf, | |
| goto out; | |
| /* got it */ | |
| h1_tunnel_go_state(cf, ts, H1_TUNNEL_RESPONSE, data); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case H1_TUNNEL_RESPONSE: | |
| CURL_TRC_CF(data, cf, "CONNECT response"); | |
| @@ -155,7 +155,7 @@ static void h2_tunnel_go_state(struct Curl_cfilter *cf, | |
| infof(data, "CONNECT phase completed"); | |
| data->state.authproxy.done = TRUE; | |
| data->state.authproxy.multipass = FALSE; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case H2_TUNNEL_FAILED: | |
| if(new_state == H2_TUNNEL_FAILED) | |
| CURL_TRC_CF(data, cf, "[%d] new tunnel state 'failed'", ts->stream_id); | |
| @@ -1033,7 +1033,7 @@ static CURLcode H2_CONNECT(struct Curl_cfilter *cf, | |
| if(result) | |
| goto out; | |
| h2_tunnel_go_state(cf, ts, H2_TUNNEL_CONNECT, data); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case H2_TUNNEL_CONNECT: | |
| /* see that the request is completely sent */ | |
| @@ -1052,7 +1052,7 @@ static CURLcode H2_CONNECT(struct Curl_cfilter *cf, | |
| result = CURLE_OK; | |
| goto out; | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case H2_TUNNEL_RESPONSE: | |
| DEBUGASSERT(ts->has_final_response); | |
| @@ -125,7 +125,7 @@ static CURLcode cf_haproxy_connect(struct Curl_cfilter *cf, | |
| if(result) | |
| goto out; | |
| ctx->state = HAPROXY_SEND; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case HAPROXY_SEND: | |
| len = Curl_dyn_len(&ctx->data_out); | |
| if(len > 0) { | |
| @@ -141,7 +141,7 @@ static CURLcode cf_haproxy_connect(struct Curl_cfilter *cf, | |
| } | |
| } | |
| ctx->state = HAPROXY_DONE; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| default: | |
| Curl_dyn_free(&ctx->data_out); | |
| break; | |
| @@ -266,7 +266,7 @@ static CURLcode cf_hc_connect(struct Curl_cfilter *cf, | |
| cf_hc_baller_init(&ctx->h21_baller, cf, data, "h21", | |
| cf->conn->transport); | |
| ctx->state = CF_HC_CONNECT; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CF_HC_CONNECT: | |
| if(cf_hc_baller_is_active(&ctx->h3_baller)) { | |
| @@ -163,7 +163,8 @@ tcpkeepalive(struct Curl_easy *data, | |
| /* only set IDLE and INTVL if setting KEEPALIVE is successful */ | |
| if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, | |
| (void *)&optval, sizeof(optval)) < 0) { | |
| - | infof(data, "Failed to set SO_KEEPALIVE on fd %d", sockfd); |
| + | infof(data, "Failed to set SO_KEEPALIVE on fd %" CURL_FORMAT_SOCKET_T, |
| + | sockfd); |
| } | |
| else { | |
| #if defined(SIO_KEEPALIVE_VALS) | |
| @@ -178,8 +179,9 @@ tcpkeepalive(struct Curl_easy *data, | |
| vals.keepaliveinterval = optval; | |
| if(WSAIoctl(sockfd, SIO_KEEPALIVE_VALS, (LPVOID) &vals, sizeof(vals), | |
| NULL, 0, &dummy, NULL, NULL) != 0) { | |
| - | infof(data, "Failed to set SIO_KEEPALIVE_VALS on fd %d: %d", |
| - | (int)sockfd, WSAGetLastError()); |
| + | infof(data, "Failed to set SIO_KEEPALIVE_VALS on fd " |
| + | "%" CURL_FORMAT_SOCKET_T ": %d", |
| + | sockfd, WSAGetLastError()); |
| } | |
| #else | |
| #ifdef TCP_KEEPIDLE | |
| @@ -187,7 +189,8 @@ tcpkeepalive(struct Curl_easy *data, | |
| KEEPALIVE_FACTOR(optval); | |
| if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE, | |
| (void *)&optval, sizeof(optval)) < 0) { | |
| - | infof(data, "Failed to set TCP_KEEPIDLE on fd %d", sockfd); |
| + | infof(data, "Failed to set TCP_KEEPIDLE on fd %" CURL_FORMAT_SOCKET_T, |
| + | sockfd); |
| } | |
| #elif defined(TCP_KEEPALIVE) | |
| /* Mac OS X style */ | |
| @@ -195,7 +198,8 @@ tcpkeepalive(struct Curl_easy *data, | |
| KEEPALIVE_FACTOR(optval); | |
| if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE, | |
| (void *)&optval, sizeof(optval)) < 0) { | |
| - | infof(data, "Failed to set TCP_KEEPALIVE on fd %d", sockfd); |
| + | infof(data, "Failed to set TCP_KEEPALIVE on fd %" CURL_FORMAT_SOCKET_T, |
| + | sockfd); |
| } | |
| #endif | |
| #ifdef TCP_KEEPINTVL | |
| @@ -203,7 +207,8 @@ tcpkeepalive(struct Curl_easy *data, | |
| KEEPALIVE_FACTOR(optval); | |
| if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL, | |
| (void *)&optval, sizeof(optval)) < 0) { | |
| - | infof(data, "Failed to set TCP_KEEPINTVL on fd %d", sockfd); |
| + | infof(data, "Failed to set TCP_KEEPINTVL on fd %" CURL_FORMAT_SOCKET_T, |
| + | sockfd); |
| } | |
| #endif | |
| #endif | |
| @@ -983,20 +988,14 @@ static CURLcode cf_socket_open(struct Curl_cfilter *cf, | |
| if(result) | |
| goto out; | |
| - | #ifndef CURL_DISABLE_VERBOSE_STRINGS |
| - | { |
| - | const char *ipmsg; |
| #ifdef ENABLE_IPV6 | |
| - | if(ctx->addr.family == AF_INET6) { |
| - | set_ipv6_v6only(ctx->sock, 0); |
| - | ipmsg = " Trying [%s]:%d..."; |
| - | } |
| - | else |
| - | #endif |
| - | ipmsg = " Trying %s:%d..."; |
| - | infof(data, ipmsg, ctx->r_ip, ctx->r_port); |
| + | if(ctx->addr.family == AF_INET6) { |
| + | set_ipv6_v6only(ctx->sock, 0); |
| + | infof(data, " Trying [%s]:%d...", ctx->r_ip, ctx->r_port); |
| } | |
| + | else |
| #endif | |
| + | infof(data, " Trying %s:%d...", ctx->r_ip, ctx->r_port); |
| #ifdef ENABLE_IPV6 | |
| is_tcp = (ctx->addr.family == AF_INET | |
| @@ -1574,7 +1573,7 @@ static CURLcode cf_socket_query(struct Curl_cfilter *cf, | |
| *when = ctx->first_byte_at; | |
| break; | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| default: | |
| *when = ctx->connected_at; | |
| break; | |
| @@ -34,23 +34,6 @@ struct Curl_easy; | |
| struct connectdata; | |
| struct Curl_sockaddr_ex; | |
| - | #ifndef SIZEOF_CURL_SOCKET_T |
| - | /* configure and cmake check and set the define */ |
| - | # ifdef _WIN64 |
| - | # define SIZEOF_CURL_SOCKET_T 8 |
| - | # else |
| - | /* default guess */ |
| - | # define SIZEOF_CURL_SOCKET_T 4 |
| - | # endif |
| - | #endif |
| - | |
| - | #if SIZEOF_CURL_SOCKET_T < 8 |
| - | # define CURL_FORMAT_SOCKET_T "d" |
| - | #else |
| - | # define CURL_FORMAT_SOCKET_T "qd" |
| - | #endif |
| - | |
| - | |
| /* | |
| * The Curl_sockaddr_ex structure is basically libcurl's external API | |
| * curl_sockaddr structure with enough space available to directly hold any | |
| @@ -892,7 +892,7 @@ static CURLcode cf_he_connect(struct Curl_cfilter *cf, | |
| if(result) | |
| return result; | |
| ctx->state = SCFST_WAITING; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case SCFST_WAITING: | |
| result = is_connected(cf, data, done); | |
| if(!result && *done) { | |
| @@ -925,7 +925,7 @@ Curl_cookie_add(struct Curl_easy *data, | |
| if(!co->spath) | |
| badcookie = TRUE; | |
| fields++; /* add a field and fall down to secure */ | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case 3: | |
| co->secure = FALSE; | |
| if(strcasecompare(ptr, "TRUE")) { | |
| @@ -481,7 +481,7 @@ CURLcode Curl_output_ntlm_wb(struct Curl_easy *data, struct connectdata *conn, | |
| /* connection is already authenticated, | |
| * don't send a header in future requests */ | |
| *state = NTLMSTATE_LAST; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case NTLMSTATE_LAST: | |
| Curl_safefree(*allocuserpwd); | |
| authp->done = TRUE; | |
| @@ -259,6 +259,33 @@ | |
| #include <curl/system.h> | |
| + | /* curl uses its own printf() function internally. It understands the GNU |
| + | * format. Use this format, so that is matches the GNU format attribute we |
| + | * use with the mingw compiler, allowing it to verify them at compile-time. |
| + | */ |
| + | #ifdef __MINGW32__ |
| + | # undef CURL_FORMAT_CURL_OFF_T |
| + | # undef CURL_FORMAT_CURL_OFF_TU |
| + | # define CURL_FORMAT_CURL_OFF_T "lld" |
| + | # define CURL_FORMAT_CURL_OFF_TU "llu" |
| + | #endif |
| + | |
| + | /* based on logic in "curl/mprintf.h" */ |
| + | |
| + | #if (defined(__GNUC__) || defined(__clang__)) && \ |
| + | defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ |
| + | !defined(CURL_NO_FMT_CHECKS) |
| + | #if defined(__MINGW32__) && !defined(__clang__) |
| + | #define CURL_PRINTF(fmt, arg) \ |
| + | __attribute__((format(gnu_printf, fmt, arg))) |
| + | #else |
| + | #define CURL_PRINTF(fmt, arg) \ |
| + | __attribute__((format(__printf__, fmt, arg))) |
| + | #endif |
| + | #else |
| + | #define CURL_PRINTF(fmt, arg) |
| + | #endif |
| + | |
| /* | |
| * Use getaddrinfo to resolve the IPv4 address literal. If the current network | |
| * interface doesn't support IPv4, but supports IPv6, NAT64, and DNS64, | |
| @@ -408,6 +435,24 @@ | |
| #define SIZEOF_TIME_T 4 | |
| #endif | |
| + | #ifndef SIZEOF_CURL_SOCKET_T |
| + | /* configure and cmake check and set the define */ |
| + | # ifdef _WIN64 |
| + | # define SIZEOF_CURL_SOCKET_T 8 |
| + | # else |
| + | /* default guess */ |
| + | # define SIZEOF_CURL_SOCKET_T 4 |
| + | # endif |
| + | #endif |
| + | |
| + | #if SIZEOF_CURL_SOCKET_T < 8 |
| + | # define CURL_FORMAT_SOCKET_T "d" |
| + | #elif defined(__MINGW32__) |
| + | # define CURL_FORMAT_SOCKET_T "zd" |
| + | #else |
| + | # define CURL_FORMAT_SOCKET_T "qd" |
| + | #endif |
| + | |
| /* | |
| * Default sizeof(off_t) in case it hasn't been defined in config file. | |
| */ | |
| @@ -648,6 +693,17 @@ | |
| #endif | |
| #endif | |
| + | /* fallthrough attribute */ |
| + | |
| + | #if !defined(FALLTHROUGH) |
| + | #if (defined(__GNUC__) && __GNUC__ >= 7) || \ |
| + | (defined(__clang__) && __clang_major__ >= 10) |
| + | # define FALLTHROUGH() __attribute__((fallthrough)) |
| + | #else |
| + | # define FALLTHROUGH() do {} while (0) |
| + | #endif |
| + | #endif |
| + | |
| /* | |
| * Include macros and defines that should only be processed once. | |
| */ | |
| @@ -92,7 +92,14 @@ void Curl_failf(struct Curl_easy *data, const char *fmt, ...) | |
| int len; | |
| char error[CURL_ERROR_SIZE + 2]; | |
| va_start(ap, fmt); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| len = mvsnprintf(error, CURL_ERROR_SIZE, fmt, ap); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| if(data->set.errorbuffer && !data->state.errorbuf) { | |
| strcpy(data->set.errorbuffer, error); | |
| @@ -118,7 +125,14 @@ void Curl_infof(struct Curl_easy *data, const char *fmt, ...) | |
| int len; | |
| char buffer[MAXINFO + 2]; | |
| va_start(ap, fmt); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| len = mvsnprintf(buffer, MAXINFO, fmt, ap); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| va_end(ap); | |
| buffer[len++] = '\n'; | |
| buffer[len] = '\0'; | |
| @@ -136,7 +150,14 @@ void Curl_trc_cf_infof(struct Curl_easy *data, struct Curl_cfilter *cf, | |
| char buffer[MAXINFO + 2]; | |
| len = msnprintf(buffer, MAXINFO, "[%s] ", cf->cft->name); | |
| va_start(ap, fmt); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| len += mvsnprintf(buffer + len, MAXINFO - len, fmt, ap); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| va_end(ap); | |
| buffer[len++] = '\n'; | |
| buffer[len] = '\0'; | |
| @@ -58,14 +58,7 @@ void Curl_debug(struct Curl_easy *data, curl_infotype type, | |
| * Output a failure message on registered callbacks for transfer. | |
| */ | |
| void Curl_failf(struct Curl_easy *data, | |
| - | #if defined(__GNUC__) && !defined(printf) && \ |
| - | defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ |
| - | !defined(__MINGW32__) |
| - | const char *fmt, ...) |
| - | __attribute__((format(printf, 2, 3))); |
| - | #else |
| - | const char *fmt, ...); |
| - | #endif |
| + | const char *fmt, ...) CURL_PRINTF(2, 3); |
| #define failf Curl_failf | |
| @@ -102,26 +95,14 @@ void Curl_failf(struct Curl_easy *data, | |
| * Output an informational message when transfer's verbose logging is enabled. | |
| */ | |
| void Curl_infof(struct Curl_easy *data, | |
| - | #if defined(__GNUC__) && !defined(printf) && defined(CURL_HAVE_C99) && \ |
| - | !defined(__MINGW32__) |
| - | const char *fmt, ...) |
| - | __attribute__((format(printf, 2, 3))); |
| - | #else |
| - | const char *fmt, ...); |
| - | #endif |
| + | const char *fmt, ...) CURL_PRINTF(2, 3); |
| /** | |
| * Output an informational message when both transfer's verbose logging | |
| * and connection filters verbose logging are enabled. | |
| */ | |
| void Curl_trc_cf_infof(struct Curl_easy *data, struct Curl_cfilter *cf, | |
| - | #if defined(__GNUC__) && !defined(printf) && defined(CURL_HAVE_C99) && \ |
| - | !defined(__MINGW32__) |
| - | const char *fmt, ...) |
| - | __attribute__((format(printf, 3, 4))); |
| - | #else |
| - | const char *fmt, ...); |
| - | #endif |
| + | const char *fmt, ...) CURL_PRINTF(3, 4); |
| #else /* defined(CURL_DISABLE_VERBOSE_STRINGS) */ | |
| /* All informational messages are not compiled in for size savings */ | |
| @@ -122,6 +122,9 @@ static char *unescape_word(const char *input) | |
| } | |
| /* sendf() sends formatted data to the server */ | |
| + | static CURLcode sendf(curl_socket_t sockfd, struct Curl_easy *data, |
| + | const char *fmt, ...) CURL_PRINTF(3, 4); |
| + | |
| static CURLcode sendf(curl_socket_t sockfd, struct Curl_easy *data, | |
| const char *fmt, ...) | |
| { | |
| @@ -132,7 +135,14 @@ static CURLcode sendf(curl_socket_t sockfd, struct Curl_easy *data, | |
| char *sptr; | |
| va_list ap; | |
| va_start(ap, fmt); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| s = vaprintf(fmt, ap); /* returns an allocated string */ | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| va_end(ap); | |
| if(!s) | |
| return CURLE_OUT_OF_MEMORY; /* failure */ | |
| @@ -201,7 +201,14 @@ CURLcode Curl_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap) | |
| return CURLE_OK; | |
| #else | |
| char *str; | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| str = vaprintf(fmt, ap); /* this allocs a new string to append */ | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| if(str) { | |
| CURLcode result = dyn_nappend(s, (unsigned char *)str, strlen(str)); | |
| @@ -61,9 +61,9 @@ CURLcode Curl_dyn_addn(struct dynbuf *s, const void *mem, size_t len) | |
| CURLcode Curl_dyn_add(struct dynbuf *s, const char *str) | |
| WARN_UNUSED_RESULT; | |
| CURLcode Curl_dyn_addf(struct dynbuf *s, const char *fmt, ...) | |
| - | WARN_UNUSED_RESULT; |
| + | WARN_UNUSED_RESULT CURL_PRINTF(2, 3); |
| CURLcode Curl_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap) | |
| - | WARN_UNUSED_RESULT; |
| + | WARN_UNUSED_RESULT CURL_PRINTF(2, 0); |
| void Curl_dyn_reset(struct dynbuf *s); | |
| CURLcode Curl_dyn_tail(struct dynbuf *s, size_t trail); | |
| CURLcode Curl_dyn_setlen(struct dynbuf *s, size_t set); | |
| @@ -480,13 +480,15 @@ static int events_socket(struct Curl_easy *easy, /* easy handle */ | |
| ev->list = nxt; | |
| free(m); | |
| m = nxt; | |
| - | infof(easy, "socket cb: socket %d REMOVED", s); |
| + | infof(easy, "socket cb: socket %" CURL_FORMAT_SOCKET_T |
| + | " REMOVED", s); |
| } | |
| else { | |
| /* The socket 's' is already being monitored, update the activity | |
| mask. Convert from libcurl bitmask to the poll one. */ | |
| m->socket.events = socketcb2poll(what); | |
| - | infof(easy, "socket cb: socket %d UPDATED as %s%s", s, |
| + | infof(easy, "socket cb: socket %" CURL_FORMAT_SOCKET_T |
| + | " UPDATED as %s%s", s, |
| (what&CURL_POLL_IN)?"IN":"", | |
| (what&CURL_POLL_OUT)?"OUT":""); | |
| } | |
| @@ -510,7 +512,8 @@ static int events_socket(struct Curl_easy *easy, /* easy handle */ | |
| m->socket.events = socketcb2poll(what); | |
| m->socket.revents = 0; | |
| ev->list = m; | |
| - | infof(easy, "socket cb: socket %d ADDED as %s%s", s, |
| + | infof(easy, "socket cb: socket %" CURL_FORMAT_SOCKET_T |
| + | " ADDED as %s%s", s, |
| (what&CURL_POLL_IN)?"IN":"", | |
| (what&CURL_POLL_OUT)?"OUT":""); | |
| } | |
| @@ -599,8 +602,9 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) | |
| if(fds[i].revents) { | |
| /* socket activity, tell libcurl */ | |
| int act = poll2cselect(fds[i].revents); /* convert */ | |
| - | infof(multi->easyp, "call curl_multi_socket_action(socket %d)", |
| - | fds[i].fd); |
| + | infof(multi->easyp, |
| + | "call curl_multi_socket_action(socket " |
| + | "%" CURL_FORMAT_SOCKET_T ")", fds[i].fd); |
| mcode = curl_multi_socket_action(multi, fds[i].fd, act, | |
| &ev->running_handles); | |
| } | |
| @@ -277,7 +277,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, | |
| case CURLFORM_PTRNAME: | |
| current_form->flags |= HTTPPOST_PTRNAME; /* fall through */ | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CURLFORM_COPYNAME: | |
| if(current_form->name) | |
| return_value = CURL_FORMADD_OPTION_TWICE; | |
| @@ -303,7 +303,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, | |
| */ | |
| case CURLFORM_PTRCONTENTS: | |
| current_form->flags |= HTTPPOST_PTRCONTENTS; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CURLFORM_COPYCONTENTS: | |
| if(current_form->value) | |
| return_value = CURL_FORMADD_OPTION_TWICE; | |
| @@ -3124,7 +3124,6 @@ static CURLcode ftp_statemachine(struct Curl_easy *data, | |
| break; | |
| case FTP_QUIT: | |
| - | /* fallthrough, just stop! */ |
| default: | |
| /* internal error */ | |
| ftp_state(data, FTP_STOP); | |
| @@ -3251,14 +3250,13 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, | |
| case CURLE_REMOTE_FILE_NOT_FOUND: | |
| case CURLE_WRITE_ERROR: | |
| /* the connection stays alive fine even though this happened */ | |
| - | /* fall-through */ |
| case CURLE_OK: /* doesn't affect the control connection's status */ | |
| if(!premature) | |
| break; | |
| /* until we cope better with prematurely ended requests, let them | |
| * fallback as if in complete failure */ | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| default: /* by default, an error means the control connection is | |
| wedged and should not be used anymore */ | |
| ftpc->ctl_valid = FALSE; | |
| @@ -3888,7 +3888,7 @@ CURLcode Curl_http_statusline(struct Curl_easy *data, | |
| * fields. */ | |
| if(data->set.timecondition) | |
| data->info.timecond = TRUE; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case 204: | |
| /* (quote from RFC2616, section 10.2.5): The server has | |
| * fulfilled the request but does not need to return an | |
| @@ -1376,7 +1376,6 @@ static CURLcode imap_statemachine(struct Curl_easy *data, | |
| break; | |
| case IMAP_LOGOUT: | |
| - | /* fallthrough, just stop! */ |
| default: | |
| /* internal error */ | |
| imap_state(data, IMAP_STOP); | |
| @@ -1795,7 +1794,14 @@ static CURLcode imap_sendf(struct Curl_easy *data, const char *fmt, ...) | |
| if(!result) { | |
| va_list ap; | |
| va_start(ap, fmt); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| result = Curl_pp_vsendf(data, &imapc->pp, Curl_dyn_ptr(&imapc->dyn), ap); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| va_end(ap); | |
| } | |
| return result; | |
| @@ -417,7 +417,6 @@ static char level_to_char(int level) | |
| case PROT_PRIVATE: | |
| return 'P'; | |
| case PROT_CMD: | |
| - | /* Fall through */ |
| default: | |
| /* Those 2 cases should not be reached! */ | |
| break; | |
| @@ -137,7 +137,7 @@ static void _ldap_free_urldesc(LDAPURLDesc *ludp); | |
| _ldap_trace x; \ | |
| } while(0) | |
| - | static void _ldap_trace(const char *fmt, ...); |
| + | static void _ldap_trace(const char *fmt, ...) CURL_PRINTF(1, 2); |
| #else | |
| #define LDAP_TRACE(x) Curl_nop_stmt | |
| #endif | |
| @@ -317,8 +317,16 @@ curl_socket_t curl_dbg_socket(int domain, int type, int protocol, | |
| sockfd = socket(domain, type, protocol); | |
| - | if(source && (sockfd != CURL_SOCKET_BAD)) |
| + | if(source && (sockfd != CURL_SOCKET_BAD)) { |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| curl_dbg_log(fmt, source, line, sockfd); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| + | } |
| return sockfd; | |
| } | |
| @@ -365,8 +373,16 @@ int curl_dbg_socketpair(int domain, int type, int protocol, | |
| int res = socketpair(domain, type, protocol, socket_vector); | |
| - | if(source && (0 == res)) |
| + | if(source && (0 == res)) { |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| curl_dbg_log(fmt, source, line, socket_vector[0], socket_vector[1]); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| + | } |
| return res; | |
| } | |
| @@ -386,8 +402,16 @@ curl_socket_t curl_dbg_accept(curl_socket_t s, void *saddr, void *saddrlen, | |
| curl_socket_t sockfd = accept(s, addr, addrlen); | |
| - | if(source && (sockfd != CURL_SOCKET_BAD)) |
| + | if(source && (sockfd != CURL_SOCKET_BAD)) { |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| curl_dbg_log(fmt, source, line, sockfd); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| + | } |
| return sockfd; | |
| } | |
| @@ -401,8 +425,16 @@ void curl_dbg_mark_sclose(curl_socket_t sockfd, int line, const char *source) | |
| "FD %s:%d sclose(%ld)\n": | |
| "FD %s:%d sclose(%zd)\n"; | |
| - | if(source) |
| + | if(source) { |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| curl_dbg_log(fmt, source, line, sockfd); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| + | } |
| } | |
| /* this is our own defined way to close sockets on *ALL* platforms */ | |
| @@ -467,7 +499,14 @@ void curl_dbg_log(const char *format, ...) | |
| return; | |
| va_start(ap, format); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| nchars = mvsnprintf(buf, LOGLINE_BUFSIZE, format, ap); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| va_end(ap); | |
| if(nchars > LOGLINE_BUFSIZE - 1) | |
| @@ -72,7 +72,7 @@ CURL_EXTERN ALLOC_FUNC wchar_t *curl_dbg_wcsdup(const wchar_t *str, | |
| CURL_EXTERN void curl_dbg_memdebug(const char *logname); | |
| CURL_EXTERN void curl_dbg_memlimit(long limit); | |
| - | CURL_EXTERN void curl_dbg_log(const char *format, ...); |
| + | CURL_EXTERN void curl_dbg_log(const char *format, ...) CURL_PRINTF(1, 2); |
| /* file descriptor manipulators */ | |
| CURL_EXTERN curl_socket_t curl_dbg_socket(int domain, int type, int protocol, | |
| @@ -817,7 +817,7 @@ static size_t read_part_content(curl_mimepart *part, | |
| case MIMEKIND_FILE: | |
| if(part->fp && feof(part->fp)) | |
| break; /* At EOF. */ | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| default: | |
| if(part->readfunc) { | |
| if(!(part->flags & MIME_FAST_READ)) { | |
| @@ -936,7 +936,7 @@ static size_t readback_part(curl_mimepart *part, | |
| mimesetstate(&part->state, MIMESTATE_USERHEADERS, hdr->next); | |
| break; | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case MIMESTATE_CURLHEADERS: | |
| if(!hdr) | |
| mimesetstate(&part->state, MIMESTATE_USERHEADERS, part->userheaders); | |
| @@ -970,7 +970,7 @@ static size_t readback_part(curl_mimepart *part, | |
| fclose(part->fp); | |
| part->fp = NULL; | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CURL_READFUNC_ABORT: | |
| case CURL_READFUNC_PAUSE: | |
| case READ_ERROR: | |
| @@ -1680,7 +1680,14 @@ CURLcode Curl_mime_add_header(struct curl_slist **slp, const char *fmt, ...) | |
| va_list ap; | |
| va_start(ap, fmt); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| s = curl_mvaprintf(fmt, ap); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| va_end(ap); | |
| if(s) { | |
| @@ -130,7 +130,8 @@ struct curl_mimepart { | |
| size_t lastreadstatus; /* Last read callback returned status. */ | |
| }; | |
| - | CURLcode Curl_mime_add_header(struct curl_slist **slp, const char *fmt, ...); |
| + | CURLcode Curl_mime_add_header(struct curl_slist **slp, const char *fmt, ...) |
| + | CURL_PRINTF(2, 3); |
| #if !defined(CURL_DISABLE_MIME) && (!defined(CURL_DISABLE_HTTP) || \ | |
| !defined(CURL_DISABLE_SMTP) || \ | |
| @@ -365,7 +365,7 @@ static int dprintf_Pass1(const char *format, struct va_stack *vto, | |
| case '0': | |
| if(!(flags & FLAGS_LEFT)) | |
| flags |= FLAGS_PAD_NIL; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case '1': case '2': case '3': case '4': | |
| case '5': case '6': case '7': case '8': case '9': | |
| flags |= FLAGS_WIDTH; | |
| @@ -385,6 +385,7 @@ static int dprintf_Pass1(const char *format, struct va_stack *vto, | |
| break; | |
| case '\0': | |
| fmt--; | |
| + | FALLTHROUGH(); |
| default: | |
| break; | |
| } | |
| @@ -401,7 +402,7 @@ static int dprintf_Pass1(const char *format, struct va_stack *vto, | |
| switch(*fmt) { | |
| case 'S': | |
| flags |= FLAGS_ALT; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case 's': | |
| vto[i].type = FORMAT_STRING; | |
| break; | |
| @@ -671,7 +671,7 @@ MQTT_SUBACK_COMING: | |
| data->req.bytecount = 0; | |
| data->req.size = remlen; | |
| mq->npacket = remlen; /* get this many bytes */ | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case MQTT_PUB_REMAIN: { | |
| /* read rest of packet, but no more. Cap to buffer size */ | |
| size_t rest = mq->npacket; | |
| @@ -776,7 +776,7 @@ static CURLcode mqtt_doing(struct Curl_easy *data, bool *done) | |
| /* remember the first byte */ | |
| mq->npacket = 0; | |
| mqstate(data, MQTT_REMAINING_LENGTH, MQTT_NOSTATE); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case MQTT_REMAINING_LENGTH: | |
| do { | |
| result = Curl_read(data, sockfd, (char *)&byte, 1, &nread); | |
| @@ -672,6 +672,7 @@ static CURLcode multi_done(struct Curl_easy *data, | |
| many callbacks and protocols work differently, we could potentially do | |
| this more fine-grained in the future. */ | |
| premature = TRUE; | |
| + | FALLTHROUGH(); |
| default: | |
| break; | |
| } | |
| @@ -216,7 +216,6 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy, | |
| /* case C passes through, not a match */ | |
| break; | |
| case TYPE_IPV4: | |
| - | /* FALLTHROUGH */ |
| case TYPE_IPV6: { | |
| const char *check = token; | |
| char *slash; | |
| @@ -645,7 +645,7 @@ static CURLcode oldap_state_mechs_resp(struct Curl_easy *data, | |
| switch(code) { | |
| case LDAP_SIZELIMIT_EXCEEDED: | |
| infof(data, "Too many authentication mechanisms\n"); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case LDAP_SUCCESS: | |
| case LDAP_NO_RESULTS_RETURNED: | |
| if(Curl_sasl_can_authenticate(&li->sasl, data)) | |
| @@ -793,7 +793,7 @@ static CURLcode oldap_connecting(struct Curl_easy *data, bool *done) | |
| result = oldap_perform_bind(data, OLDAP_BIND); | |
| break; | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case OLDAP_TLS: | |
| result = oldap_ssl_connect(data, OLDAP_TLS); | |
| if(result && data->set.use_ssl != CURLUSESSL_TRY) | |
| @@ -1014,7 +1014,7 @@ static ssize_t oldap_recv(struct Curl_easy *data, int sockindex, char *buf, | |
| switch(code) { | |
| case LDAP_SIZELIMIT_EXCEEDED: | |
| infof(data, "There are more than %d entries", lr->nument); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case LDAP_SUCCESS: | |
| data->req.size = data->req.bytecount; | |
| break; | |
| @@ -113,7 +113,7 @@ timediff_t Curl_pp_state_timeout(struct Curl_easy *data, | |
| */ | |
| CURLcode Curl_pp_sendf(struct Curl_easy *data, | |
| struct pingpong *pp, | |
| - | const char *fmt, ...); |
| + | const char *fmt, ...) CURL_PRINTF(3, 4); |
| /*********************************************************************** | |
| * | |
| @@ -128,7 +128,7 @@ CURLcode Curl_pp_sendf(struct Curl_easy *data, | |
| CURLcode Curl_pp_vsendf(struct Curl_easy *data, | |
| struct pingpong *pp, | |
| const char *fmt, | |
| - | va_list args); |
| + | va_list args) CURL_PRINTF(3, 0); |
| /* | |
| * Curl_pp_readresp() | |
| @@ -1268,7 +1268,6 @@ static CURLcode smtp_statemachine(struct Curl_easy *data, | |
| break; | |
| case SMTP_QUIT: | |
| - | /* fallthrough, just stop! */ |
| default: | |
| /* internal error */ | |
| smtp_state(data, SMTP_STOP); | |
| @@ -353,9 +353,10 @@ static CURLproxycode do_SOCKS4(struct Curl_cfilter *cf, | |
| return CURLPX_OK; | |
| } | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| + | case CONNECT_RESOLVED: |
| CONNECT_RESOLVED: | |
| - | case CONNECT_RESOLVED: { |
| + | { |
| struct Curl_addrinfo *hp = NULL; | |
| /* | |
| * We cannot use 'hostent' as a struct that Curl_resolv() returns. It | |
| @@ -393,9 +394,9 @@ CONNECT_RESOLVED: | |
| if(!hp) | |
| return CURLPX_RESOLVE_HOST; | |
| } | |
| - | /* FALLTHROUGH */ |
| - | CONNECT_REQ_INIT: |
| + | FALLTHROUGH(); |
| case CONNECT_REQ_INIT: | |
| + | CONNECT_REQ_INIT: |
| /* | |
| * This is currently not supporting "Identification Protocol (RFC1413)". | |
| */ | |
| @@ -442,7 +443,7 @@ CONNECT_REQ_INIT: | |
| sx->outstanding = packetsize; | |
| sxstate(sx, data, CONNECT_REQ_SENDING); | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CONNECT_REQ_SENDING: | |
| /* Send request */ | |
| presult = socks_state_send(cf, sx, data, CURLPX_SEND_CONNECT, | |
| @@ -458,7 +459,7 @@ CONNECT_REQ_INIT: | |
| sx->outp = socksreq; | |
| sxstate(sx, data, CONNECT_SOCKS_READ); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CONNECT_SOCKS_READ: | |
| /* Receive response */ | |
| presult = socks_state_recv(cf, sx, data, CURLPX_RECV_CONNECT, | |
| @@ -640,12 +641,12 @@ static CURLproxycode do_SOCKS5(struct Curl_cfilter *cf, | |
| /* remain in sending state */ | |
| return CURLPX_OK; | |
| } | |
| - | /* FALLTHROUGH */ |
| - | CONNECT_SOCKS_READ_INIT: |
| + | FALLTHROUGH(); |
| case CONNECT_SOCKS_READ_INIT: | |
| + | CONNECT_SOCKS_READ_INIT: |
| sx->outstanding = 2; /* expect two bytes */ | |
| sx->outp = socksreq; /* store it here */ | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CONNECT_SOCKS_READ: | |
| presult = socks_state_recv(cf, sx, data, CURLPX_RECV_CONNECT, | |
| "initial SOCKS5 response"); | |
| @@ -749,7 +750,7 @@ CONNECT_AUTH_INIT: | |
| sx->outstanding = len; | |
| sx->outp = socksreq; | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CONNECT_AUTH_SEND: | |
| presult = socks_state_send(cf, sx, data, CURLPX_SEND_AUTH, | |
| "SOCKS5 sub-negotiation request"); | |
| @@ -762,7 +763,7 @@ CONNECT_AUTH_INIT: | |
| sx->outp = socksreq; | |
| sx->outstanding = 2; | |
| sxstate(sx, data, CONNECT_AUTH_READ); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CONNECT_AUTH_READ: | |
| presult = socks_state_recv(cf, sx, data, CURLPX_RECV_AUTH, | |
| "SOCKS5 sub-negotiation response"); | |
| @@ -781,9 +782,9 @@ CONNECT_AUTH_INIT: | |
| /* Everything is good so far, user was authenticated! */ | |
| sxstate(sx, data, CONNECT_REQ_INIT); | |
| - | /* FALLTHROUGH */ |
| - | CONNECT_REQ_INIT: |
| + | FALLTHROUGH(); |
| case CONNECT_REQ_INIT: | |
| + | CONNECT_REQ_INIT: |
| if(socks5_resolve_local) { | |
| enum resolve_t rc = Curl_resolv(data, sx->hostname, sx->remote_port, | |
| TRUE, &dns); | |
| @@ -820,9 +821,10 @@ CONNECT_REQ_INIT: | |
| return CURLPX_OK; | |
| } | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| + | case CONNECT_RESOLVED: |
| CONNECT_RESOLVED: | |
| - | case CONNECT_RESOLVED: { |
| + | { |
| char dest[MAX_IPADR_LEN]; /* printable address */ | |
| struct Curl_addrinfo *hp = NULL; | |
| if(dns) | |
| @@ -923,10 +925,10 @@ CONNECT_RESOLVE_REMOTE: | |
| infof(data, "SOCKS5 connect to %s:%d (remotely resolved)", | |
| sx->hostname, sx->remote_port); | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| - | CONNECT_REQ_SEND: |
| case CONNECT_REQ_SEND: | |
| + | CONNECT_REQ_SEND: |
| /* PORT MSB */ | |
| socksreq[len++] = (unsigned char)((sx->remote_port >> 8) & 0xff); | |
| /* PORT LSB */ | |
| @@ -941,7 +943,7 @@ CONNECT_REQ_SEND: | |
| sx->outp = socksreq; | |
| sx->outstanding = len; | |
| sxstate(sx, data, CONNECT_REQ_SENDING); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CONNECT_REQ_SENDING: | |
| presult = socks_state_send(cf, sx, data, CURLPX_SEND_REQUEST, | |
| "SOCKS5 connect request"); | |
| @@ -960,7 +962,7 @@ CONNECT_REQ_SEND: | |
| sx->outstanding = 10; /* minimum packet size is 10 */ | |
| sx->outp = socksreq; | |
| sxstate(sx, data, CONNECT_REQ_READ); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CONNECT_REQ_READ: | |
| presult = socks_state_recv(cf, sx, data, CURLPX_RECV_REQACK, | |
| "SOCKS5 connect request ack"); | |
| @@ -1049,7 +1051,7 @@ CONNECT_REQ_SEND: | |
| #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) | |
| } | |
| #endif | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CONNECT_REQ_READ_MORE: | |
| presult = socks_state_recv(cf, sx, data, CURLPX_RECV_ADDRESS, | |
| "SOCKS5 connect request address"); | |
| @@ -331,9 +331,15 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, | |
| failf(data, "Failed to determine user name."); | |
| return CURLE_COULDNT_CONNECT; | |
| } | |
| - | infof(data, "SOCKS5 server authenticated user %s with GSS-API.", |
| - | names.sUserName); |
| - | s_pSecFn->FreeContextBuffer(names.sUserName); |
| + | else { |
| + | #ifndef CURL_DISABLE_VERBOSE_STRINGS |
| + | char *user_utf8 = curlx_convert_tchar_to_UTF8(names.sUserName); |
| + | infof(data, "SOCKS5 server authenticated user %s with GSS-API.", |
| + | (user_utf8 ? user_utf8 : "(unknown)")); |
| + | curlx_unicodefree(user_utf8); |
| + | #endif |
| + | s_pSecFn->FreeContextBuffer(names.sUserName); |
| + | } |
| /* Do encryption */ | |
| socksreq[0] = 1; /* GSS-API subnegotiation version */ | |
| @@ -1546,7 +1546,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) | |
| case 0: /* timeout */ | |
| pfd[0].revents = 0; | |
| pfd[1].revents = 0; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| default: /* read! */ | |
| if(pfd[0].revents & POLLIN) { | |
| /* read data from network */ | |
| @@ -712,24 +712,30 @@ static int ipv4_normalize(struct dynbuf *host) | |
| Curl_dyn_reset(host); | |
| result = Curl_dyn_addf(host, "%u.%u.%u.%u", | |
| - | parts[0] >> 24, (parts[0] >> 16) & 0xff, |
| - | (parts[0] >> 8) & 0xff, parts[0] & 0xff); |
| + | (unsigned int)(parts[0] >> 24), |
| + | (unsigned int)((parts[0] >> 16) & 0xff), |
| + | (unsigned int)((parts[0] >> 8) & 0xff), |
| + | (unsigned int)(parts[0] & 0xff)); |
| break; | |
| case 1: /* a.b -- 8.24 bits */ | |
| if((parts[0] > 0xff) || (parts[1] > 0xffffff)) | |
| return HOST_NAME; | |
| Curl_dyn_reset(host); | |
| result = Curl_dyn_addf(host, "%u.%u.%u.%u", | |
| - | parts[0], (parts[1] >> 16) & 0xff, |
| - | (parts[1] >> 8) & 0xff, parts[1] & 0xff); |
| + | (unsigned int)(parts[0]), |
| + | (unsigned int)((parts[1] >> 16) & 0xff), |
| + | (unsigned int)((parts[1] >> 8) & 0xff), |
| + | (unsigned int)(parts[1] & 0xff)); |
| break; | |
| case 2: /* a.b.c -- 8.8.16 bits */ | |
| if((parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xffff)) | |
| return HOST_NAME; | |
| Curl_dyn_reset(host); | |
| result = Curl_dyn_addf(host, "%u.%u.%u.%u", | |
| - | parts[0], parts[1], (parts[2] >> 8) & 0xff, |
| - | parts[2] & 0xff); |
| + | (unsigned int)(parts[0]), |
| + | (unsigned int)(parts[1]), |
| + | (unsigned int)((parts[2] >> 8) & 0xff), |
| + | (unsigned int)(parts[2] & 0xff)); |
| break; | |
| case 3: /* a.b.c.d -- 8.8.8.8 bits */ | |
| if((parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xff) || | |
| @@ -737,7 +743,10 @@ static int ipv4_normalize(struct dynbuf *host) | |
| return HOST_NAME; | |
| Curl_dyn_reset(host); | |
| result = Curl_dyn_addf(host, "%u.%u.%u.%u", | |
| - | parts[0], parts[1], parts[2], parts[3]); |
| + | (unsigned int)(parts[0]), |
| + | (unsigned int)(parts[1]), |
| + | (unsigned int)(parts[2]), |
| + | (unsigned int)(parts[3])); |
| break; | |
| } | |
| if(result) | |
| @@ -314,7 +314,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, | |
| &type_3_desc, | |
| &attrs, &expiry); | |
| if(status != SEC_E_OK) { | |
| - | infof(data, "NTLM handshake failure (type-3 message): Status=%x", |
| + | infof(data, "NTLM handshake failure (type-3 message): Status=%lx", |
| status); | |
| if(status == SEC_E_INSUFFICIENT_MEMORY) | |
| @@ -179,7 +179,7 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf, | |
| qctx->no_gso = TRUE; | |
| return send_packet_no_gso(cf, data, qctx, pkt, pktlen, gsolen, psent); | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| default: | |
| failf(data, "sendmsg() returned %zd (errno %d)", sent, SOCKERRNO); | |
| return CURLE_SEND_ERROR; | |
| @@ -439,11 +439,8 @@ static int myssh_is_known(struct Curl_easy *data) | |
| keymatch = CURLKHMATCH_OK; | |
| break; | |
| case SSH_KNOWN_HOSTS_OTHER: | |
| - | /* fallthrough */ |
| case SSH_KNOWN_HOSTS_NOT_FOUND: | |
| - | /* fallthrough */ |
| case SSH_KNOWN_HOSTS_UNKNOWN: | |
| - | /* fallthrough */ |
| case SSH_KNOWN_HOSTS_ERROR: | |
| keymatch = CURLKHMATCH_MISSING; | |
| break; | |
| @@ -459,7 +456,6 @@ static int myssh_is_known(struct Curl_easy *data) | |
| keymatch = CURLKHMATCH_OK; | |
| break; | |
| case SSH_SERVER_FILE_NOT_FOUND: | |
| - | /* fallthrough */ |
| case SSH_SERVER_NOT_KNOWN: | |
| keymatch = CURLKHMATCH_MISSING; | |
| break; | |
| @@ -623,7 +619,7 @@ restart: | |
| if(rc < 0) | |
| return SSH_ERROR; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case 1: | |
| sshc->kbd_state = 1; | |
| @@ -698,7 +694,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| ssh_set_blocking(sshc->ssh_session, 0); | |
| state(data, SSH_S_STARTUP); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case SSH_S_STARTUP: | |
| rc = ssh_connect(sshc->ssh_session); | |
| @@ -713,7 +709,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| state(data, SSH_HOSTKEY); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case SSH_HOSTKEY: | |
| rc = myssh_is_known(data); | |
| @@ -723,7 +719,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| } | |
| state(data, SSH_AUTHLIST); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case SSH_AUTHLIST:{ | |
| sshc->authed = FALSE; | |
| @@ -904,7 +900,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| break; | |
| } | |
| state(data, SSH_AUTH_PASS); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case SSH_AUTH_PASS: | |
| rc = ssh_userauth_password(sshc->ssh_session, NULL, conn->passwd); | |
| @@ -967,7 +963,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| break; | |
| } | |
| state(data, SSH_SFTP_REALPATH); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case SSH_SFTP_REALPATH: | |
| /* | |
| * Get the "home" directory | |
| @@ -1554,7 +1550,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| sshc->readdir_longentry = NULL; | |
| state(data, SSH_SFTP_READDIR_BOTTOM); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case SSH_SFTP_READDIR_BOTTOM: | |
| if(Curl_dyn_addn(&sshc->readdir_buf, "\n", 1)) | |
| result = CURLE_OUT_OF_MEMORY; | |
| @@ -1878,7 +1874,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| break; | |
| } | |
| state(data, SSH_SCP_DOWNLOAD); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case SSH_SCP_DOWNLOAD:{ | |
| curl_off_t bytecount; | |
| @@ -1942,7 +1938,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| ssh_set_blocking(sshc->ssh_session, 0); | |
| state(data, SSH_SESSION_DISCONNECT); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case SSH_SESSION_DISCONNECT: | |
| /* during weird times when we've been prematurely aborted, the channel | |
| @@ -1965,7 +1961,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| data->state.most_recent_ftp_entrypath = NULL; | |
| state(data, SSH_SESSION_FREE); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case SSH_SESSION_FREE: | |
| if(sshc->ssh_session) { | |
| ssh_free(sshc->ssh_session); | |
| @@ -2016,7 +2012,6 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| break; | |
| case SSH_QUIT: | |
| - | /* fallthrough, just stop! */ |
| default: | |
| /* internal error */ | |
| sshc->nextstate = SSH_NO_STATE; | |
| @@ -2607,7 +2602,7 @@ static ssize_t sftp_recv(struct Curl_easy *data, int sockindex, | |
| return -1; | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case 1: | |
| conn->proto.sshc.sftp_recv_state = 1; | |
| @@ -589,10 +589,9 @@ static CURLcode ssh_knownhost(struct Curl_easy *data) | |
| switch(rc) { | |
| default: /* unknown return codes will equal reject */ | |
| - | /* FALLTHROUGH */ |
| case CURLKHSTAT_REJECT: | |
| state(data, SSH_SESSION_FREE); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CURLKHSTAT_DEFER: | |
| /* DEFER means bail out but keep the SSH_HOSTKEY state */ | |
| result = sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION; | |
| @@ -601,9 +600,8 @@ static CURLcode ssh_knownhost(struct Curl_easy *data) | |
| /* remove old host+key that doesn't match */ | |
| if(host) | |
| libssh2_knownhost_del(sshc->kh, host); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CURLKHSTAT_FINE: | |
| - | /* FALLTHROUGH */ |
| case CURLKHSTAT_FINE_ADD_TO_FILE: | |
| /* proceed */ | |
| if(keycheck != LIBSSH2_KNOWNHOST_CHECK_MATCH) { | |
| @@ -997,7 +995,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) | |
| } | |
| state(data, SSH_S_STARTUP); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case SSH_S_STARTUP: | |
| rc = session_startup(sshc->ssh_session, sock); | |
| @@ -1016,7 +1014,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) | |
| state(data, SSH_HOSTKEY); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case SSH_HOSTKEY: | |
| /* | |
| * Before we authenticate we should check the hostkey's fingerprint | |
| @@ -3024,7 +3022,6 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block) | |
| break; | |
| case SSH_QUIT: | |
| - | /* fallthrough, just stop! */ |
| default: | |
| /* internal error */ | |
| sshc->nextstate = SSH_NO_STATE; | |
| @@ -1088,6 +1088,7 @@ static int ssl_ui_reader(UI *ui, UI_STRING *uis) | |
| UI_set_result(ui, uis, password); | |
| return 1; | |
| } | |
| + | FALLTHROUGH(); |
| default: | |
| break; | |
| } | |
| @@ -1106,6 +1107,7 @@ static int ssl_ui_writer(UI *ui, UI_STRING *uis) | |
| (UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD)) { | |
| return 1; | |
| } | |
| + | FALLTHROUGH(); |
| default: | |
| break; | |
| } | |
| @@ -1523,7 +1525,7 @@ fail: | |
| case SSL_FILETYPE_PEM: | |
| if(cert_done) | |
| break; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case SSL_FILETYPE_ASN1: | |
| cert_use_result = key_blob ? | |
| SSL_CTX_use_PrivateKey_blob(ctx, key_blob, file_type, key_passwd) : | |
| @@ -2849,7 +2851,7 @@ ossl_set_ssl_version_min_max_legacy(ctx_option_t *ctx_options, | |
| failf(data, OSSL_PACKAGE " was built without TLS 1.3 support"); | |
| return CURLE_NOT_BUILT_IN; | |
| #endif | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CURL_SSLVERSION_TLSv1_2: | |
| #if OPENSSL_VERSION_NUMBER >= 0x1000100FL | |
| *ctx_options |= SSL_OP_NO_TLSv1_1; | |
| @@ -2857,7 +2859,7 @@ ossl_set_ssl_version_min_max_legacy(ctx_option_t *ctx_options, | |
| failf(data, OSSL_PACKAGE " was built without TLS 1.2 support"); | |
| return CURLE_NOT_BUILT_IN; | |
| #endif | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CURL_SSLVERSION_TLSv1_1: | |
| #if OPENSSL_VERSION_NUMBER >= 0x1000100FL | |
| *ctx_options |= SSL_OP_NO_TLSv1; | |
| @@ -2865,7 +2867,7 @@ ossl_set_ssl_version_min_max_legacy(ctx_option_t *ctx_options, | |
| failf(data, OSSL_PACKAGE " was built without TLS 1.1 support"); | |
| return CURLE_NOT_BUILT_IN; | |
| #endif | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CURL_SSLVERSION_TLSv1_0: | |
| case CURL_SSLVERSION_TLSv1: | |
| break; | |
| @@ -2876,12 +2878,12 @@ ossl_set_ssl_version_min_max_legacy(ctx_option_t *ctx_options, | |
| #if OPENSSL_VERSION_NUMBER >= 0x1000100FL | |
| *ctx_options |= SSL_OP_NO_TLSv1_1; | |
| #endif | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CURL_SSLVERSION_MAX_TLSv1_1: | |
| #if OPENSSL_VERSION_NUMBER >= 0x1000100FL | |
| *ctx_options |= SSL_OP_NO_TLSv1_2; | |
| #endif | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CURL_SSLVERSION_MAX_TLSv1_2: | |
| #ifdef TLS1_3_VERSION | |
| *ctx_options |= SSL_OP_NO_TLSv1_3; | |
| @@ -156,7 +156,7 @@ static ssize_t tls_recv_more(struct Curl_cfilter *cf, | |
| size_t errorlen; | |
| rustls_error(rresult, errorbuf, sizeof(errorbuf), &errorlen); | |
| failf(data, "rustls_connection_process_new_packets: %.*s", | |
| - | errorlen, errorbuf); |
| + | (int)errorlen, errorbuf); |
| *err = map_error(rresult); | |
| return -1; | |
| } | |
| @@ -225,7 +225,7 @@ cr_recv(struct Curl_cfilter *cf, struct Curl_easy *data, | |
| char errorbuf[255]; | |
| size_t errorlen; | |
| rustls_error(rresult, errorbuf, sizeof(errorbuf), &errorlen); | |
| - | failf(data, "rustls_connection_read: %.*s", errorlen, errorbuf); |
| + | failf(data, "rustls_connection_read: %.*s", (int)errorlen, errorbuf); |
| *err = CURLE_READ_ERROR; | |
| nread = -1; | |
| goto out; | |
| @@ -301,7 +301,7 @@ cr_send(struct Curl_cfilter *cf, struct Curl_easy *data, | |
| &plainwritten); | |
| if(rresult != RUSTLS_RESULT_OK) { | |
| rustls_error(rresult, errorbuf, sizeof(errorbuf), &errorlen); | |
| - | failf(data, "rustls_connection_write: %.*s", errorlen, errorbuf); |
| + | failf(data, "rustls_connection_write: %.*s", (int)errorlen, errorbuf); |
| *err = CURLE_WRITE_ERROR; | |
| return -1; | |
| } | |
| @@ -459,7 +459,7 @@ cr_init_backend(struct Curl_cfilter *cf, struct Curl_easy *data, | |
| } | |
| if(result != RUSTLS_RESULT_OK) { | |
| rustls_error(result, errorbuf, sizeof(errorbuf), &errorlen); | |
| - | failf(data, "rustls_client_connection_new: %.*s", errorlen, errorbuf); |
| + | failf(data, "rustls_client_connection_new: %.*s", (int)errorlen, errorbuf); |
| return CURLE_COULDNT_CONNECT; | |
| } | |
| rustls_connection_set_userdata(rconn, backend); | |
| @@ -563,8 +563,8 @@ cr_connect_common(struct Curl_cfilter *cf, | |
| return CURLE_SSL_CONNECT_ERROR; | |
| } | |
| if(blocking && 0 == what) { | |
| - | failf(data, "rustls connection timeout after %d ms", |
| - | socket_check_timeout); |
| + | failf(data, "rustls connection timeout after %" |
| + | CURL_FORMAT_TIMEDIFF_T " ms", socket_check_timeout); |
| return CURLE_OPERATION_TIMEDOUT; | |
| } | |
| if(0 == what) { | |
| @@ -666,7 +666,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, | |
| cert_showfilename_error); | |
| else | |
| failf(data, "schannel: Failed to import cert file %s, " | |
| - | "last error is 0x%x", |
| + | "last error is 0x%lx", |
| cert_showfilename_error, errorcode); | |
| return CURLE_SSL_CERTPROBLEM; | |
| } | |
| @@ -677,7 +677,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, | |
| if(!client_certs[0]) { | |
| failf(data, "schannel: Failed to get certificate from file %s" | |
| - | ", last error is 0x%x", |
| + | ", last error is 0x%lx", |
| cert_showfilename_error, GetLastError()); | |
| CertCloseStore(cert_store, 0); | |
| return CURLE_SSL_CERTPROBLEM; | |
| @@ -690,10 +690,15 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, | |
| CERT_STORE_OPEN_EXISTING_FLAG | cert_store_name, | |
| cert_store_path); | |
| if(!cert_store) { | |
| - | failf(data, "schannel: Failed to open cert store %x %s, " |
| - | "last error is 0x%x", |
| - | cert_store_name, cert_store_path, GetLastError()); |
| + | char *path_utf8 = |
| + | curlx_convert_tchar_to_UTF8(cert_store_path); |
| + | failf(data, "schannel: Failed to open cert store %lx %s, " |
| + | "last error is 0x%lx", |
| + | cert_store_name, |
| + | (path_utf8 ? path_utf8 : "(unknown)"), |
| + | GetLastError()); |
| free(cert_store_path); | |
| + | curlx_unicodefree(path_utf8); |
| curlx_unicodefree(cert_path); | |
| return CURLE_SSL_CERTPROBLEM; | |
| } | |
| @@ -172,7 +172,7 @@ static CURLcode add_certs_data_to_store(HCERTSTORE trust_store, | |
| /* Sanity check that the cert_context object is the right type */ | |
| if(CERT_QUERY_CONTENT_CERT != actual_content_type) { | |
| failf(data, | |
| - | "schannel: unexpected content type '%d' when extracting " |
| + | "schannel: unexpected content type '%lu' when extracting " |
| "certificate from CA file '%s'", | |
| actual_content_type, ca_file_text); | |
| result = CURLE_SSL_CACERT_BADFILE; | |
| @@ -753,7 +753,7 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, | |
| failf(data, "schannel: CertGetCertificateChain trust error" | |
| " CERT_TRUST_REVOCATION_STATUS_UNKNOWN"); | |
| else | |
| - | failf(data, "schannel: CertGetCertificateChain error mask: 0x%08x", |
| + | failf(data, "schannel: CertGetCertificateChain error mask: 0x%08lx", |
| dwTrustErrorMask); | |
| result = CURLE_PEER_FAILED_VERIFICATION; | |
| } | |
| @@ -1084,9 +1084,7 @@ static ssize_t wolfssl_recv(struct Curl_cfilter *cf, | |
| *curlcode = CURLE_OK; | |
| return 0; | |
| case SSL_ERROR_NONE: | |
| - | /* FALLTHROUGH */ |
| case SSL_ERROR_WANT_READ: | |
| - | /* FALLTHROUGH */ |
| case SSL_ERROR_WANT_WRITE: | |
| /* there's data pending, re-invoke wolfSSL_read() */ | |
| CURL_TRC_CF(data, cf, "wolfssl_recv(len=%zu) -> AGAIN", blen); | |
| @@ -379,10 +379,10 @@ utf8asn1str(char **to, int type, const char *from, const char *end) | |
| case 4: | |
| wc = (wc << 8) | *(const unsigned char *) from++; | |
| wc = (wc << 8) | *(const unsigned char *) from++; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case 2: | |
| wc = (wc << 8) | *(const unsigned char *) from++; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| default: /* case 1: */ | |
| wc = (wc << 8) | *(const unsigned char *) from++; | |
| } | |
| @@ -548,7 +548,7 @@ static const char *GTime2str(const char *beg, const char *end) | |
| break; | |
| case 2: | |
| sec1 = fracp[-2]; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case 1: | |
| sec2 = fracp[-1]; | |
| break; | |
| @@ -606,6 +606,7 @@ static const char *UTime2str(const char *beg, const char *end) | |
| switch(tzp - sec) { | |
| case 0: | |
| sec = "00"; | |
| + | FALLTHROUGH(); |
| case 2: | |
| break; | |
| default: | |
| @@ -964,7 +965,7 @@ static int do_pubkey(struct Curl_easy *data, int certnum, | |
| */ | |
| const size_t len = ((pubkey->end - pubkey->beg - 2) * 4); | |
| if(!certnum) | |
| - | infof(data, " ECC Public Key (%lu bits)", len); |
| + | infof(data, " ECC Public Key (%zu bits)", len); |
| if(data->set.ssl.certinfo) { | |
| char q[sizeof(len) * 8 / 3 + 1]; | |
| (void)msnprintf(q, sizeof(q), "%zu", len); | |
| @@ -998,7 +999,7 @@ static int do_pubkey(struct Curl_easy *data, int certnum, | |
| if(len > 32) | |
| elem.beg = q; /* Strip leading zero bytes. */ | |
| if(!certnum) | |
| - | infof(data, " RSA Public Key (%lu bits)", len); |
| + | infof(data, " RSA Public Key (%zu bits)", len); |
| if(data->set.ssl.certinfo) { | |
| char r[sizeof(len) * 8 / 3 + 1]; | |
| msnprintf(r, sizeof(r), "%zu", len); | |
| @@ -296,7 +296,7 @@ static CURLcode ws_dec_pass(struct ws_decoder *dec, | |
| case WS_DEC_INIT: | |
| ws_dec_reset(dec); | |
| dec->state = WS_DEC_HEAD; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case WS_DEC_HEAD: | |
| result = ws_dec_read_head(dec, data, inraw); | |
| if(result) { | |
| @@ -321,7 +321,7 @@ static CURLcode ws_dec_pass(struct ws_decoder *dec, | |
| dec->state = WS_DEC_INIT; | |
| break; | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case WS_DEC_PAYLOAD: | |
| result = ws_dec_pass_payload(dec, data, inraw, write_payload, write_ctx); | |
| ws_dec_info(dec, data, "passing"); | |
| @@ -832,6 +832,8 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ | |
| dnl Only clang 2.9 or later | |
| if test "$compiler_num" -ge "209"; then | |
| tmp_CFLAGS="$tmp_CFLAGS -Wno-sign-conversion" | |
| + | # CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [sign-conversion]) # FIXME |
| + | # tmp_CFLAGS="$tmp_CFLAGS -Wno-error=sign-conversion" # FIXME |
| CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [shift-sign-overflow]) | |
| # CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [padded]) # Not used because we cannot change public structs | |
| fi | |
| @@ -839,6 +841,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ | |
| dnl Only clang 3.0 or later | |
| if test "$compiler_num" -ge "300"; then | |
| CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [language-extension-token]) | |
| + | tmp_CFLAGS="$tmp_CFLAGS -Wformat=2" |
| fi | |
| # | |
| dnl Only clang 3.2 or later | |
| @@ -887,6 +890,10 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ | |
| CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [assign-enum]) | |
| CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [extra-semi-stmt]) | |
| fi | |
| + | dnl clang 10 or later |
| + | if test "$compiler_num" -ge "1000"; then |
| + | tmp_CFLAGS="$tmp_CFLAGS -Wimplicit-fallthrough" # we have silencing markup for clang 10.0 and above only |
| + | fi |
| fi | |
| dnl Disable pointer to bool conversion warnings since they cause | |
| dnl lib/securetransp.c cause several warnings for checks we want. | |
| @@ -1016,8 +1023,10 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ | |
| CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [type-limits old-style-declaration]) | |
| CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [missing-parameter-type empty-body]) | |
| CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [clobbered ignored-qualifiers]) | |
| - | CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [conversion]) |
| + | CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [conversion trampolines]) |
| tmp_CFLAGS="$tmp_CFLAGS -Wno-sign-conversion" | |
| + | # CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [sign-conversion]) # FIXME |
| + | # tmp_CFLAGS="$tmp_CFLAGS -Wno-error=sign-conversion" # FIXME |
| CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [vla]) | |
| dnl required for -Warray-bounds, included in -Wall | |
| tmp_CFLAGS="$tmp_CFLAGS -ftree-vrp" | |
| @@ -1063,10 +1072,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ | |
| CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [alloc-zero]) | |
| tmp_CFLAGS="$tmp_CFLAGS -Wformat-overflow=2" | |
| tmp_CFLAGS="$tmp_CFLAGS -Wformat-truncation=2" | |
| - | if test "$compiler_num" -lt "1200"; then |
| - | dnl gcc 12 doesn't acknowledge our comment markups |
| - | tmp_CFLAGS="$tmp_CFLAGS -Wimplicit-fallthrough=4" |
| - | fi |
| + | tmp_CFLAGS="$tmp_CFLAGS -Wimplicit-fallthrough" |
| fi | |
| # | |
| dnl Only gcc 10 or later | |
| @@ -1282,7 +1282,7 @@ curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...) | |
| result = curl_easy_setopt(easy, tag, &blob); | |
| break; | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case CURLOPT_ERRORBUFFER: /* This is an output buffer. */ | |
| result = Curl_vsetopt(easy, tag, arg); | |
| break; | |
| @@ -217,7 +217,7 @@ int tool_debug_cb(CURL *handle, curl_infotype type, | |
| switch(type) { | |
| case CURLINFO_TEXT: | |
| fprintf(output, "%s%s== Info: %.*s", timebuf, idsbuf, (int)size, data); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| default: /* in case a new one is introduced to shock us */ | |
| return 0; | |
| @@ -208,7 +208,14 @@ int tool_progress_cb(void *clientp, | |
| memset(line, '#', num); | |
| line[num] = '\0'; | |
| msnprintf(format, sizeof(format), "\r%%-%ds %%5.1f%%%%", barwidth); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| fprintf(bar->out, format, line, percent); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| } | |
| fflush(bar->out); | |
| bar->prev = point; | |
| @@ -113,7 +113,14 @@ CURLcode easysrc_addf(struct slist_wc **plist, const char *fmt, ...) | |
| char *bufp; | |
| va_list ap; | |
| va_start(ap, fmt); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| bufp = curlx_mvaprintf(fmt, ap); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| va_end(ap); | |
| if(!bufp) { | |
| ret = CURLE_OUT_OF_MEMORY; | |
| @@ -40,7 +40,7 @@ extern int easysrc_slist_count; /* Number of curl_slist variables */ | |
| extern CURLcode easysrc_init(void); | |
| extern CURLcode easysrc_add(struct slist_wc **plist, const char *bupf); | |
| extern CURLcode easysrc_addf(struct slist_wc **plist, | |
| - | const char *fmt, ...); |
| + | const char *fmt, ...) CURL_PRINTF(2, 3); |
| extern CURLcode easysrc_perform(void); | |
| extern CURLcode easysrc_cleanup(void); | |
| @@ -278,7 +278,7 @@ static CURLcode tool2curlparts(CURL *curl, struct tool_mime *m, | |
| case TOOLMIME_STDIN: | |
| if(!filename) | |
| filename = "-"; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case TOOLMIME_STDINDATA: | |
| ret = curl_mime_data_cb(part, m->size, | |
| (curl_read_callback) tool_mime_stdin_read, | |
| @@ -2337,7 +2337,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ | |
| config->file_clobber_mode = toggle ? CLOBBER_ALWAYS : CLOBBER_NEVER; | |
| break; | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case 'o': /* --output */ | |
| /* output file */ | |
| { | |
| @@ -2640,7 +2640,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ | |
| switch(*nextarg) { | |
| case '+': | |
| nextarg++; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| default: | |
| /* If-Modified-Since: (section 14.28 in RFC2068) */ | |
| config->timecond = CURL_TIMECOND_IFMODSINCE; | |
| @@ -275,22 +275,19 @@ clean: | |
| curl_free(pathbuffer); | |
| curl_url_cleanup(gatewayurl); | |
| { | |
| - | const char *msg = NULL; |
| switch(result) { | |
| case CURLE_URL_MALFORMAT: | |
| - | msg = "malformed target URL"; |
| + | helpf(tool_stderr, "malformed target URL"); |
| break; | |
| case CURLE_FILE_COULDNT_READ_FILE: | |
| - | msg = "IPFS automatic gateway detection failed"; |
| + | helpf(tool_stderr, "IPFS automatic gateway detection failed"); |
| break; | |
| case CURLE_BAD_FUNCTION_ARGUMENT: | |
| - | msg = "--ipfs-gateway was given a malformed URL"; |
| + | helpf(tool_stderr, "--ipfs-gateway was given a malformed URL"); |
| break; | |
| default: | |
| break; | |
| } | |
| - | if(msg) |
| - | helpf(tool_stderr, msg); |
| } | |
| return result; | |
| } | |
| @@ -48,7 +48,14 @@ static void voutf(struct GlobalConfig *config, | |
| char *ptr; | |
| char *print_buffer; | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| print_buffer = curlx_mvaprintf(fmt, ap); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| if(!print_buffer) | |
| return; | |
| len = strlen(print_buffer); | |
| @@ -119,7 +126,14 @@ void helpf(FILE *errors, const char *fmt, ...) | |
| va_start(ap, fmt); | |
| DEBUGASSERT(!strchr(fmt, '\n')); | |
| fputs("curl: ", errors); /* prefix it */ | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| vfprintf(errors, fmt, ap); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| va_end(ap); | |
| fputs("\n", errors); /* newline it */ | |
| } | |
| @@ -26,9 +26,13 @@ | |
| #include "tool_setup.h" | |
| #include "tool_cfgable.h" | |
| - | void warnf(struct GlobalConfig *config, const char *fmt, ...); |
| - | void notef(struct GlobalConfig *config, const char *fmt, ...); |
| - | void helpf(FILE *errors, const char *fmt, ...); |
| - | void errorf(struct GlobalConfig *config, const char *fmt, ...); |
| + | void warnf(struct GlobalConfig *config, const char *fmt, ...) |
| + | CURL_PRINTF(2, 3); |
| + | void notef(struct GlobalConfig *config, const char *fmt, ...) |
| + | CURL_PRINTF(2, 3); |
| + | void helpf(FILE *errors, const char *fmt, ...) |
| + | CURL_PRINTF(2, 3); |
| + | void errorf(struct GlobalConfig *config, const char *fmt, ...) |
| + | CURL_PRINTF(2, 3); |
| #endif /* HEADER_CURL_TOOL_MSGS_H */ | |
| @@ -408,7 +408,7 @@ ParameterError proto2num(struct OperationConfig *config, | |
| break; | |
| case set: | |
| protoset[0] = NULL; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case allow: | |
| protoset_set(protoset, p); | |
| break; | |
| @@ -247,8 +247,15 @@ static char *c_escape(const char *str, curl_off_t len) | |
| format = "\\%03o"; | |
| } | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| result = curlx_dyn_addf(&escaped, format, | |
| (unsigned int) *(unsigned char *) s); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| } | |
| } | |
| } | |
| @@ -431,7 +438,7 @@ static CURLcode libcurl_generate_mime_part(CURL *curl, | |
| case TOOLMIME_STDIN: | |
| if(!filename) | |
| filename = "-"; | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case TOOLMIME_STDINDATA: | |
| /* Can only be reading stdin in the current context. */ | |
| CODE1("curl_mime_data_cb(part%d, -1, (curl_read_callback) fread, \\", | |
| @@ -127,7 +127,7 @@ static CURLcode glob_set(struct URLGlob *glob, char **patternp, | |
| if(multiply(amount, pat->content.Set.size + 1)) | |
| return GLOBERROR("range overflow", 0, CURLE_URL_MALFORMAT); | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| case ',': | |
| *buf = '\0'; | |
| @@ -171,7 +171,7 @@ static CURLcode glob_set(struct URLGlob *glob, char **patternp, | |
| ++pattern; | |
| ++(*posp); | |
| } | |
| - | /* FALLTHROUGH */ |
| + | FALLTHROUGH(); |
| default: | |
| *buf++ = *pattern++; /* copy character to set element */ | |
| ++(*posp); | |
| @@ -56,10 +56,7 @@ int my_trace(CURL *handle, curl_infotype type, | |
| switch(type) { | |
| case CURLINFO_TEXT: | |
| fprintf(stderr, "== Info: %s", data); | |
| - | /* FALLTHROUGH */ |
| - | default: /* in case a new one is introduced to shock us */ |
| return 0; | |
| - | |
| case CURLINFO_HEADER_OUT: | |
| text = "=> Send header"; | |
| break; | |
| @@ -76,6 +73,8 @@ int my_trace(CURL *handle, curl_infotype type, | |
| return 0; | |
| text = "<= Recv data"; | |
| break; | |
| + | default: /* in case a new one is introduced to shock us */ |
| + | return 0; |
| } | |
| fprintf(stderr, "%s, %lu bytes (0x%lx)\n", | |
| @@ -102,10 +102,7 @@ int my_trace(CURL *handle, curl_infotype type, | |
| switch(type) { | |
| case CURLINFO_TEXT: | |
| fprintf(stderr, "== Info: %s", data); | |
| - | /* FALLTHROUGH */ |
| - | default: /* in case a new one is introduced to shock us */ |
| return 0; | |
| - | |
| case CURLINFO_HEADER_OUT: | |
| text = "=> Send header"; | |
| break; | |
| @@ -124,6 +121,8 @@ int my_trace(CURL *handle, curl_infotype type, | |
| case CURLINFO_SSL_DATA_IN: | |
| text = "<= Recv SSL data"; | |
| break; | |
| + | default: /* in case a new one is introduced to shock us */ |
| + | return 0; |
| } | |
| dump(text, (unsigned char *)data, size, 1); | |
| @@ -1662,6 +1662,10 @@ static int huge(void) | |
| for(i = 0; i < 7; i++) { | |
| char *partp; | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| msnprintf(total, sizeof(total), | |
| url, | |
| (i == 0)? &bigpart[1] : smallpart, | |
| @@ -1671,6 +1675,9 @@ static int huge(void) | |
| (i == 4)? &bigpart[1] : smallpart, | |
| (i == 5)? &bigpart[1] : smallpart, | |
| (i == 6)? &bigpart[1] : smallpart); | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| rc = curl_url_set(urlp, CURLUPART_URL, total, CURLU_NON_SUPPORT_SCHEME); | |
| if((!i && (rc != CURLUE_BAD_SCHEME)) || | |
| (i && rc)) { | |
| @@ -84,7 +84,7 @@ int test(char *URL) | |
| th = _beginthreadex(NULL, 0, run_thread, &results[i], 0, NULL); | |
| #endif | |
| if(!th) { | |
| - | fprintf(stderr, "%s:%d Couldn't create thread, errno %d\n", |
| + | fprintf(stderr, "%s:%d Couldn't create thread, errno %lu\n", |
| __FILE__, __LINE__, GetLastError()); | |
| tid_count = i; | |
| test_failure = -1; | |
| @@ -164,7 +164,7 @@ int test(char *URL) | |
| time_t out = curl_getdate(dates[i].input, NULL); | |
| if(out != dates[i].output) { | |
| printf("WRONGLY %s => %ld (instead of %ld)\n", | |
| - | dates[i].input, out, dates[i].output); |
| + | dates[i].input, (long)out, (long)dates[i].output); |
| error++; | |
| } | |
| } | |
| @@ -99,6 +99,11 @@ static int fopen_works(void) | |
| return ret; | |
| } | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| + | |
| static int rlimit(int keep_open) | |
| { | |
| int nitems, i; | |
| @@ -459,6 +464,10 @@ static int rlimit(int keep_open) | |
| return 0; | |
| } | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| + | |
| int test(char *URL) | |
| { | |
| CURLcode res; | |
| @@ -99,6 +99,11 @@ static int fopen_works(void) | |
| return ret; | |
| } | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic push |
| + | #pragma clang diagnostic ignored "-Wformat-nonliteral" |
| + | #endif |
| + | |
| static int rlimit(int keep_open) | |
| { | |
| int *tmpfd; | |
| @@ -460,6 +465,10 @@ static int rlimit(int keep_open) | |
| return 0; | |
| } | |
| + | #ifdef __clang__ |
| + | #pragma clang diagnostic pop |
| + | #endif |
| + | |
| int test(char *URL) | |
| { | |
| CURLcode res; | |
| @@ -96,10 +96,7 @@ int my_trace(CURL *handle, curl_infotype type, | |
| switch(type) { | |
| case CURLINFO_TEXT: | |
| fprintf(stderr, "== Info: %s", (char *)data); | |
| - | /* FALLTHROUGH */ |
| - | default: /* in case a new one is introduced to shock us */ |
| return 0; | |
| - | |
| case CURLINFO_HEADER_OUT: | |
| text = "=> Send header"; | |
| break; | |
| @@ -118,6 +115,8 @@ int my_trace(CURL *handle, curl_infotype type, | |
| case CURLINFO_SSL_DATA_IN: | |
| text = "<= Recv SSL data"; | |
| break; | |
| + | default: /* in case a new one is introduced to shock us */ |
| + | return 0; |
| } | |
| dump(text, stderr, (unsigned char *)data, size, config->trace_ascii); | |
| @@ -1281,7 +1281,7 @@ static int test_weird_arguments(void) | |
| rc = curl_msnprintf(buf, sizeof(buf), "%d, %.*1$d", 500, 1); | |
| if(rc != sizeof(buf) - 1) { | |
| - | printf("curl_mprintf() returned %d and not %d!\n", rc, |
| + | printf("curl_mprintf() returned %d and not %zu!\n", rc, |
| sizeof(buf) - 1); | |
| errors++; | |
| } | |
| @@ -117,10 +117,7 @@ int libtest_debug_cb(CURL *handle, curl_infotype type, | |
| switch(type) { | |
| case CURLINFO_TEXT: | |
| fprintf(stderr, "%s== Info: %s", timestr, (char *)data); | |
| - | /* FALLTHROUGH */ |
| - | default: /* in case a new one is introduced to shock us */ |
| return 0; | |
| - | |
| case CURLINFO_HEADER_OUT: | |
| text = "=> Send header"; | |
| break; | |
| @@ -139,6 +136,8 @@ int libtest_debug_cb(CURL *handle, curl_infotype type, | |
| case CURLINFO_SSL_DATA_IN: | |
| text = "<= Recv SSL data"; | |
| break; | |
| + | default: /* in case a new one is introduced to shock us */ |
| + | return 0; |
| } | |
| libtest_debug_dump(timebuf, text, stderr, data, size, trace_cfg->nohex); | |
| @@ -246,7 +246,7 @@ static int connack(FILE *dump, curl_socket_t fd) | |
| rc = swrite(fd, (char *)packet, sizeof(packet)); | |
| if(rc > 0) { | |
| - | logmsg("WROTE %d bytes [CONNACK]", rc); |
| + | logmsg("WROTE %zd bytes [CONNACK]", rc); |
| loghex(packet, rc); | |
| logprotocol(FROM_SERVER, "CONNACK", 2, dump, packet, sizeof(packet)); | |
| } | |
| @@ -270,7 +270,7 @@ static int suback(FILE *dump, curl_socket_t fd, unsigned short packetid) | |
| rc = swrite(fd, (char *)packet, sizeof(packet)); | |
| if(rc == sizeof(packet)) { | |
| - | logmsg("WROTE %d bytes [SUBACK]", rc); |
| + | logmsg("WROTE %zd bytes [SUBACK]", rc); |
| loghex(packet, rc); | |
| logprotocol(FROM_SERVER, "SUBACK", 3, dump, packet, rc); | |
| return 0; | |
| @@ -292,7 +292,7 @@ static int puback(FILE *dump, curl_socket_t fd, unsigned short packetid) | |
| rc = swrite(fd, (char *)packet, sizeof(packet)); | |
| if(rc == sizeof(packet)) { | |
| - | logmsg("WROTE %d bytes [PUBACK]", rc); |
| + | logmsg("WROTE %zd bytes [PUBACK]", rc); |
| loghex(packet, rc); | |
| logprotocol(FROM_SERVER, dump, packet, rc); | |
| return 0; | |
| @@ -310,7 +310,7 @@ static int disconnect(FILE *dump, curl_socket_t fd) | |
| }; | |
| ssize_t rc = swrite(fd, (char *)packet, sizeof(packet)); | |
| if(rc == sizeof(packet)) { | |
| - | logmsg("WROTE %d bytes [DISCONNECT]", rc); |
| + | logmsg("WROTE %zd bytes [DISCONNECT]", rc); |
| loghex(packet, rc); | |
| logprotocol(FROM_SERVER, "DISCONNECT", 0, dump, packet, rc); | |
| return 0; | |
| @@ -439,7 +439,7 @@ static int publish(FILE *dump, | |
| rc = swrite(fd, (char *)packet, sendamount); | |
| if(rc > 0) { | |
| - | logmsg("WROTE %d bytes [PUBLISH]", rc); |
| + | logmsg("WROTE %zd bytes [PUBLISH]", rc); |
| loghex(packet, rc); | |
| logprotocol(FROM_SERVER, "PUBLISH", remaininglength, dump, packet, rc); | |
| } | |
| @@ -465,10 +465,10 @@ static int fixedheader(curl_socket_t fd, | |
| ssize_t rc = sread(fd, (char *)buffer, 2); | |
| int i; | |
| if(rc < 2) { | |
| - | logmsg("READ %d bytes [SHORT!]", rc); |
| + | logmsg("READ %zd bytes [SHORT!]", rc); |
| return 1; /* fail */ | |
| } | |
| - | logmsg("READ %d bytes", rc); |
| + | logmsg("READ %zd bytes", rc); |
| loghex(buffer, rc); | |
| *bytep = buffer[0]; | |
| @@ -483,7 +483,7 @@ static int fixedheader(curl_socket_t fd, | |
| } | |
| } | |
| *remaining_lengthp = decode_length(&buffer[1], i, remaining_length_bytesp); | |
| - | logmsg("Remaining Length: %ld [%d bytes]", (long) *remaining_lengthp, |
| + | logmsg("Remaining Length: %zu [%zu bytes]", *remaining_lengthp, |
| *remaining_length_bytesp); | |
| return 0; | |
| } | |
| @@ -546,7 +546,7 @@ static curl_socket_t mqttit(curl_socket_t fd) | |
| buff_size = remaining_length; | |
| buffer = realloc(buffer, buff_size); | |
| if(!buffer) { | |
| - | logmsg("Failed realloc of size %lu", buff_size); |
| + | logmsg("Failed realloc of size %zu", buff_size); |
| goto end; | |
| } | |
| } | |
| @@ -555,7 +555,7 @@ static curl_socket_t mqttit(curl_socket_t fd) | |
| /* reading variable header and payload into buffer */ | |
| rc = sread(fd, (char *)buffer, remaining_length); | |
| if(rc > 0) { | |
| - | logmsg("READ %d bytes", rc); |
| + | logmsg("READ %zd bytes", rc); |
| loghex(buffer, rc); | |
| } | |
| } | |
| @@ -592,7 +592,7 @@ static curl_socket_t mqttit(curl_socket_t fd) | |
| /* check the length of the payload */ | |
| if((ssize_t)payload_len != (rc - 12)) { | |
| - | logmsg("Payload length mismatch, expected %x got %x", |
| + | logmsg("Payload length mismatch, expected %zx got %zx", |
| rc - 12, payload_len); | |
| goto end; | |
| } | |
| @@ -633,7 +633,7 @@ static curl_socket_t mqttit(curl_socket_t fd) | |
| /* two bytes topic length */ | |
| topic_len = (buffer[2] << 8) | buffer[3]; | |
| if(topic_len != (remaining_length - 5)) { | |
| - | logmsg("Wrong topic length, got %d expected %d", |
| + | logmsg("Wrong topic length, got %u expected %zu", |
| topic_len, remaining_length - 5); | |
| goto end; | |
| } | |
| @@ -677,7 +677,7 @@ static curl_socket_t mqttit(curl_socket_t fd) | |
| dump, buffer, rc); | |
| topiclen = (buffer[1 + bytes] << 8) | buffer[2 + bytes]; | |
| - | logmsg("Got %d bytes topic", topiclen); |
| + | logmsg("Got %zu bytes topic", topiclen); |
| /* TODO: verify topiclen */ | |
| #ifdef QOS | |
| @@ -688,7 +688,7 @@ static curl_socket_t mqttit(curl_socket_t fd) | |
| /* get the request */ | |
| rc = sread(fd, (char *)&buffer[0], 2); | |
| - | logmsg("READ %d bytes [DISCONNECT]", rc); |
| + | logmsg("READ %zd bytes [DISCONNECT]", rc); |
| loghex(buffer, rc); | |
| logprotocol(FROM_CLIENT, "DISCONNECT", 0, dump, buffer, rc); | |
| goto end; | |
| @@ -767,12 +767,12 @@ static bool incoming(curl_socket_t listenfd) | |
| curl_socket_t newfd = accept(sockfd, NULL, NULL); | |
| if(CURL_SOCKET_BAD == newfd) { | |
| error = SOCKERRNO; | |
| - | logmsg("accept(%d, NULL, NULL) failed with error: (%d) %s", |
| - | sockfd, error, sstrerror(error)); |
| + | logmsg("accept(%" CURL_FORMAT_SOCKET_T ", NULL, NULL) " |
| + | "failed with error: (%d) %s", sockfd, error, sstrerror(error)); |
| } | |
| else { | |
| - | logmsg("====> Client connect, fd %d. Read config from %s", |
| - | newfd, configfile); |
| + | logmsg("====> Client connect, fd %" CURL_FORMAT_SOCKET_T ". " |
| + | "Read config from %s", newfd, configfile); |
| set_advisor_read_lock(loglockfile); | |
| (void)mqttit(newfd); /* until done */ | |
| clear_advisor_read_lock(loglockfile); | |
| @@ -910,7 +910,7 @@ static curl_socket_t sockdaemon(curl_socket_t sock, | |
| rc = listen(sock, 5); | |
| if(0 != rc) { | |
| error = SOCKERRNO; | |
| - | logmsg("listen(%d, 5) failed with error: (%d) %s", |
| + | logmsg("listen(%" CURL_FORMAT_SOCKET_T ", 5) failed with error: (%d) %s", |
| sock, error, sstrerror(error)); | |
| sclose(sock); | |
| return CURL_SOCKET_BAD; | |
| @@ -551,14 +551,14 @@ static unsigned int WINAPI select_ws_wait_thread(void *lpParameter) | |
| continue; | |
| } | |
| else { | |
| - | logmsg("[select_ws_wait_thread] PeekNamedPipe len: %d", length); |
| + | logmsg("[select_ws_wait_thread] PeekNamedPipe len: %lu", length); |
| } | |
| } | |
| else { | |
| /* if the pipe has NOT been closed, sleep and continue waiting */ | |
| ret = GetLastError(); | |
| if(ret != ERROR_BROKEN_PIPE) { | |
| - | logmsg("[select_ws_wait_thread] PeekNamedPipe error: %d", ret); |
| + | logmsg("[select_ws_wait_thread] PeekNamedPipe error: %lu", ret); |
| SleepEx(0, FALSE); | |
| continue; | |
| } | |
| @@ -1159,8 +1159,8 @@ static bool juggle(curl_socket_t *sockfdp, | |
| curl_socket_t newfd = accept(sockfd, NULL, NULL); | |
| if(CURL_SOCKET_BAD == newfd) { | |
| error = SOCKERRNO; | |
| - | logmsg("accept(%d, NULL, NULL) failed with error: (%d) %s", |
| - | sockfd, error, sstrerror(error)); |
| + | logmsg("accept(%" CURL_FORMAT_SOCKET_T ", NULL, NULL) " |
| + | "failed with error: (%d) %s", sockfd, error, sstrerror(error)); |
| } | |
| else { | |
| logmsg("====> Client connect"); | |
| @@ -1335,7 +1335,7 @@ static curl_socket_t sockdaemon(curl_socket_t sock, | |
| rc = listen(sock, 5); | |
| if(0 != rc) { | |
| error = SOCKERRNO; | |
| - | logmsg("listen(%d, 5) failed with error: (%d) %s", |
| + | logmsg("listen(%" CURL_FORMAT_SOCKET_T ", 5) failed with error: (%d) %s", |
| sock, error, sstrerror(error)); | |
| sclose(sock); | |
| return CURL_SOCKET_BAD; | |
| @@ -323,7 +323,7 @@ static curl_socket_t socks4(curl_socket_t fd, | |
| return CURL_SOCKET_BAD; | |
| } | |
| if(rc < 9) { | |
| - | logmsg("SOCKS4 connect message too short: %d", rc); |
| + | logmsg("SOCKS4 connect message too short: %zd", rc); |
| return CURL_SOCKET_BAD; | |
| } | |
| if(!config.port) | |
| @@ -350,7 +350,7 @@ static curl_socket_t socks4(curl_socket_t fd, | |
| logmsg("Sending SOCKS4 response failed!"); | |
| return CURL_SOCKET_BAD; | |
| } | |
| - | logmsg("Sent %d bytes", rc); |
| + | logmsg("Sent %zd bytes", rc); |
| loghex(response, rc); | |
| if(cd == 90) | |
| @@ -380,18 +380,18 @@ static curl_socket_t sockit(curl_socket_t fd) | |
| rc = recv(fd, (char *)buffer, sizeof(buffer), 0); | |
| if(rc <= 0) { | |
| - | logmsg("SOCKS identifier message missing, recv returned %d", rc); |
| + | logmsg("SOCKS identifier message missing, recv returned %zd", rc); |
| return CURL_SOCKET_BAD; | |
| } | |
| - | logmsg("READ %d bytes", rc); |
| + | logmsg("READ %zd bytes", rc); |
| loghex(buffer, rc); | |
| if(buffer[SOCKS5_VERSION] == 4) | |
| return socks4(fd, buffer, rc); | |
| if(rc < 3) { | |
| - | logmsg("SOCKS5 identifier message too short: %d", rc); |
| + | logmsg("SOCKS5 identifier message too short: %zd", rc); |
| return CURL_SOCKET_BAD; | |
| } | |
| @@ -408,7 +408,7 @@ static curl_socket_t sockit(curl_socket_t fd) | |
| /* after NMETHODS follows that many bytes listing the methods the client | |
| says it supports */ | |
| if(rc != (buffer[SOCKS5_NMETHODS] + 2)) { | |
| - | logmsg("Expected %d bytes, got %d", buffer[SOCKS5_NMETHODS] + 2, rc); |
| + | logmsg("Expected %d bytes, got %zd", buffer[SOCKS5_NMETHODS] + 2, rc); |
| return CURL_SOCKET_BAD; | |
| } | |
| logmsg("Incoming request deemed fine!"); | |
| @@ -421,17 +421,17 @@ static curl_socket_t sockit(curl_socket_t fd) | |
| logmsg("Sending response failed!"); | |
| return CURL_SOCKET_BAD; | |
| } | |
| - | logmsg("Sent %d bytes", rc); |
| + | logmsg("Sent %zd bytes", rc); |
| loghex(response, rc); | |
| /* expect the request or auth */ | |
| rc = recv(fd, (char *)buffer, sizeof(buffer), 0); | |
| if(rc <= 0) { | |
| - | logmsg("SOCKS5 request or auth message missing, recv returned %d", rc); |
| + | logmsg("SOCKS5 request or auth message missing, recv returned %zd", rc); |
| return CURL_SOCKET_BAD; | |
| } | |
| - | logmsg("READ %d bytes", rc); |
| + | logmsg("READ %zd bytes", rc); |
| loghex(buffer, rc); | |
| if(config.responsemethod == 2) { | |
| @@ -446,7 +446,7 @@ static curl_socket_t sockit(curl_socket_t fd) | |
| unsigned char plen; | |
| bool login = TRUE; | |
| if(rc < 5) { | |
| - | logmsg("Too short auth input: %d", rc); |
| + | logmsg("Too short auth input: %zd", rc); |
| return CURL_SOCKET_BAD; | |
| } | |
| if(buffer[SOCKS5_VERSION] != 1) { | |
| @@ -455,12 +455,12 @@ static curl_socket_t sockit(curl_socket_t fd) | |
| } | |
| ulen = buffer[SOCKS5_ULEN]; | |
| if(rc < 4 + ulen) { | |
| - | logmsg("Too short packet for username: %d", rc); |
| + | logmsg("Too short packet for username: %zd", rc); |
| return CURL_SOCKET_BAD; | |
| } | |
| plen = buffer[SOCKS5_ULEN + ulen + 1]; | |
| if(rc < 3 + ulen + plen) { | |
| - | logmsg("Too short packet for ulen %d plen %d: %d", ulen, plen, rc); |
| + | logmsg("Too short packet for ulen %d plen %d: %zd", ulen, plen, rc); |
| return CURL_SOCKET_BAD; | |
| } | |
| if((ulen != strlen(config.user)) || | |
| @@ -478,7 +478,7 @@ static curl_socket_t sockit(curl_socket_t fd) | |
| logmsg("Sending auth response failed!"); | |
| return CURL_SOCKET_BAD; | |
| } | |
| - | logmsg("Sent %d bytes", rc); |
| + | logmsg("Sent %zd bytes", rc); |
| loghex(response, rc); | |
| if(!login) | |
| return CURL_SOCKET_BAD; | |
| @@ -486,15 +486,15 @@ static curl_socket_t sockit(curl_socket_t fd) | |
| /* expect the request */ | |
| rc = recv(fd, (char *)buffer, sizeof(buffer), 0); | |
| if(rc <= 0) { | |
| - | logmsg("SOCKS5 request message missing, recv returned %d", rc); |
| + | logmsg("SOCKS5 request message missing, recv returned %zd", rc); |
| return CURL_SOCKET_BAD; | |
| } | |
| - | logmsg("READ %d bytes", rc); |
| + | logmsg("READ %zd bytes", rc); |
| loghex(buffer, rc); | |
| } | |
| if(rc < 6) { | |
| - | logmsg("Too short for request: %d", rc); |
| + | logmsg("Too short for request: %zd", rc); |
| return CURL_SOCKET_BAD; | |
| } | |
| @@ -539,7 +539,7 @@ static curl_socket_t sockit(curl_socket_t fd) | |
| return CURL_SOCKET_BAD; | |
| } | |
| if(rc < (4 + len + 2)) { | |
| - | logmsg("Request too short: %d, expected %d", rc, 4 + len + 2); |
| + | logmsg("Request too short: %zd, expected %d", rc, 4 + len + 2); |
| return CURL_SOCKET_BAD; | |
| } | |
| logmsg("Received ATYP %d", type); | |
| @@ -625,7 +625,7 @@ static curl_socket_t sockit(curl_socket_t fd) | |
| logmsg("Sending connect response failed!"); | |
| return CURL_SOCKET_BAD; | |
| } | |
| - | logmsg("Sent %d bytes", rc); |
| + | logmsg("Sent %zd bytes", rc); |
| loghex(response, rc); | |
| if(!rep) | |
| @@ -754,13 +754,14 @@ static bool incoming(curl_socket_t listenfd) | |
| curl_socket_t newfd = accept(sockfd, NULL, NULL); | |
| if(CURL_SOCKET_BAD == newfd) { | |
| error = SOCKERRNO; | |
| - | logmsg("accept(%d, NULL, NULL) failed with error: (%d) %s", |
| + | logmsg("accept(%" CURL_FORMAT_SOCKET_T ", NULL, NULL) " |
| + | "failed with error: (%d) %s", |
| sockfd, error, sstrerror(error)); | |
| } | |
| else { | |
| curl_socket_t remotefd; | |
| - | logmsg("====> Client connect, fd %d. Read config from %s", |
| - | newfd, configfile); |
| + | logmsg("====> Client connect, fd %" CURL_FORMAT_SOCKET_T ". " |
| + | "Read config from %s", newfd, configfile); |
| remotefd = sockit(newfd); /* SOCKS until done */ | |
| if(remotefd == CURL_SOCKET_BAD) { | |
| logmsg("====> Client disconnect"); | |
| @@ -943,7 +944,7 @@ static curl_socket_t sockdaemon(curl_socket_t sock, | |
| rc = listen(sock, 5); | |
| if(0 != rc) { | |
| error = SOCKERRNO; | |
| - | logmsg("listen(%d, 5) failed with error: (%d) %s", |
| + | logmsg("listen(%" CURL_FORMAT_SOCKET_T ", 5) failed with error: (%d) %s", |
| sock, error, sstrerror(error)); | |
| sclose(sock); | |
| return CURL_SOCKET_BAD; | |
| @@ -374,7 +374,7 @@ static int ProcessRequest(struct httprequest *req) | |
| req->callcount++; | |
| - | logmsg("Process %d bytes request%s", req->offset, |
| + | logmsg("Process %zu bytes request%s", req->offset, |
| req->callcount > 1?" [CONTINUED]":""); | |
| /* try to figure out the request characteristics as soon as possible, but | |
| @@ -557,14 +557,14 @@ static int ProcessRequest(struct httprequest *req) | |
| logmsg("request not complete yet"); | |
| return 0; /* not complete yet */ | |
| } | |
| - | logmsg("- request found to be complete (%d)", req->testno); |
| + | logmsg("- request found to be complete (%ld)", req->testno); |
| if(req->testno == DOCNUMBER_NOTHING) { | |
| /* check for a Testno: header with the test case number */ | |
| char *testno = strstr(line, "\nTestno: "); | |
| if(testno) { | |
| req->testno = strtol(&testno[9], NULL, 10); | |
| - | logmsg("Found test number %d in Testno: header!", req->testno); |
| + | logmsg("Found test number %ld in Testno: header!", req->testno); |
| } | |
| else { | |
| logmsg("No Testno: header"); | |
| @@ -702,8 +702,8 @@ static int ProcessRequest(struct httprequest *req) | |
| /* Negotiate iterations */ | |
| static long prev_testno = -1; | |
| static long prev_partno = -1; | |
| - | logmsg("Negotiate: prev_testno: %d, prev_partno: %d", |
| - | prev_testno, prev_partno); |
| + | logmsg("Negotiate: prev_testno: %ld, prev_partno: %ld", |
| + | prev_testno, prev_partno); |
| if(req->testno != prev_testno) { | |
| prev_testno = req->testno; | |
| prev_partno = req->partno; | |
| @@ -1198,8 +1198,8 @@ retry: | |
| int intervals = msecs_left / MAX_SLEEP_TIME_MS; | |
| if(msecs_left%MAX_SLEEP_TIME_MS) | |
| intervals++; | |
| - | logmsg("Pausing %d milliseconds after writing %d bytes", |
| - | msecs_left, written); |
| + | logmsg("Pausing %d milliseconds after writing %zd bytes", |
| + | msecs_left, written); |
| while((intervals > 0) && !got_exit_signal) { | |
| int sleep_time = msecs_left > MAX_SLEEP_TIME_MS ? | |
| MAX_SLEEP_TIME_MS : msecs_left; | |
| @@ -2334,7 +2334,8 @@ int main(int argc, char *argv[]) | |
| curl_socket_t msgsock; | |
| do { | |
| msgsock = accept_connection(sock); | |
| - | logmsg("accept_connection %d returned %d", sock, msgsock); |
| + | logmsg("accept_connection %" CURL_FORMAT_SOCKET_T |
| + | " returned %" CURL_FORMAT_SOCKET_T, sock, msgsock); |
| if(CURL_SOCKET_BAD == msgsock) | |
| goto sws_cleanup; | |
| if(req->delay) | |
| @@ -1129,7 +1129,7 @@ static int validate_access(struct testcase *test, | |
| if(!stream) { | |
| int error = errno; | |
| logmsg("fopen() failed with error: %d %s", error, strerror(error)); | |
| - | logmsg("Couldn't open test file for test : %d", testno); |
| + | logmsg("Couldn't open test file for test: %ld", testno); |
| return EACCESS; | |
| } | |
| else { | |
| @@ -139,7 +139,7 @@ static const char *win32_strerror(int err, char *buf, size_t buflen) | |
| if(!FormatMessageA((FORMAT_MESSAGE_FROM_SYSTEM | | |
| FORMAT_MESSAGE_IGNORE_INSERTS), NULL, err, | |
| LANG_NEUTRAL, buf, (DWORD)buflen, NULL)) | |
| - | msnprintf(buf, buflen, "Unknown error %lu (%#lx)", err, err); |
| + | msnprintf(buf, buflen, "Unknown error %d (%#x)", err, err); |
| return buf; | |
| } | |
| @@ -555,7 +555,7 @@ static void exit_signal_handler(int signum) | |
| static BOOL WINAPI ctrl_event_handler(DWORD dwCtrlType) | |
| { | |
| int signum = 0; | |
| - | logmsg("ctrl_event_handler: %d", dwCtrlType); |
| + | logmsg("ctrl_event_handler: %lu", dwCtrlType); |
| switch(dwCtrlType) { | |
| #ifdef SIGINT | |
| case CTRL_C_EVENT: signum = SIGINT; break; | |
| @@ -569,7 +569,7 @@ static BOOL WINAPI ctrl_event_handler(DWORD dwCtrlType) | |
| default: return FALSE; | |
| } | |
| if(signum) { | |
| - | logmsg("ctrl_event_handler: %d -> %d", dwCtrlType, signum); |
| + | logmsg("ctrl_event_handler: %lu -> %d", dwCtrlType, signum); |
| raise(signum); | |
| } | |
| return TRUE; | |
| @@ -26,7 +26,7 @@ | |
| #include "server_setup.h" | |
| char *data_to_hex(char *data, size_t len); | |
| - | void logmsg(const char *msg, ...); |
| + | void logmsg(const char *msg, ...) CURL_PRINTF(1, 2); |
| long timediff(struct timeval newer, struct timeval older); | |
| #define TEST_DATA_PATH "%s/data/test%ld" | |
| @@ -21,6 +21,8 @@ | |
| * SPDX-License-Identifier: curl | |
| * | |
| ***************************************************************************/ | |
| + | #define CURL_NO_FMT_CHECKS |
| + | |
| #include "curlcheck.h" | |
| #include "urldata.h" | |
| @@ -105,7 +107,7 @@ fail_unless(verify(result, "Simple Test 42 testing 43\n") == 0, | |
| /* Variations of empty strings */ | |
| Curl_infof(data, ""); | |
| fail_unless(strlen(result) == 1, "Empty string"); | |
| - | Curl_infof(data, "%s", NULL); |
| + | Curl_infof(data, "%s", (char *)NULL); |
| fail_unless(verify(result, "(nil)") == 0, "Passing NULL as string"); | |
| /* A string just long enough to not be truncated */ | |