Fix or silence compiler warnings happening in feature detections to reduce log noise. Warnings may also get promoted to errors in certain cases, causing missed detections. It reduces the number of warnings by 4500+ across the linux, linux-old, macos, non-native and windows GHA workflows (~142 jobs). Also move picky warning logic for MSVC/Borland to `CMake/PickyWarnings.cmake. To make them listed in the picky-warnings log output, and to also apply to feature detections to make them compile under the same conditions as source code. The hope is to help catching issues faster. It also improves code quality of feature tests. Fixed/silenced: ``` warning #177: variable "dummy" was declared but never referenced warning #177: variable "flag" was declared but never referenced warning #177: variable "res" was declared but never referenced warning #592: variable "s" is used before its value is set warning #1011: missing return statement at end of non-void function "main" warning #1786: function "SSL_CTX_set_srp_password" (declared at line 1888 of "/usr/include/openssl/ssl.h") was declared deprecated ("Since OpenSSL 3.0") warning #1786: function "SSL_CTX_set_srp_username" (declared at line 1887 of "/usr/include/openssl/ssl.h") was declared deprecated ("Since OpenSSL 3.0") warning #2332: a value of type "const char *" cannot be assigned to an entity of type "char *" (dropping qualifiers) warning: 'SSL_CTX_set_srp_password' is deprecated [-Wdeprecated-declarations] warning: 'SSL_CTX_set_srp_password' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] warning: 'SSL_CTX_set_srp_username' is deprecated [-Wdeprecated-declarations] warning: 'SSL_CTX_set_srp_username' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] warning: 'b' is used uninitialized [-Wuninitialized] warning: 'gethostname' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes] warning: Undefined or garbage value returned to caller [core.uninitialized.UndefReturn] warning: Value stored to 'i' is never read [deadcode.DeadStores] warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] warning: control reaches end of non-void function [-Wreturn-type] warning: empty expression statement has no effect; remove unnecessary ';' to silence this warning [-Wextra-semi-stmt] warning: excess elements in struct initializer warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] warning: macro "_FILE_OFFSET_BITS" is not used [-Wunused-macros] warning: macro "_REENTRANT" is not used [-Wunused-macros] warning: missing braces around initializer [-Wmissing-braces] warning: no previous extern declaration for non-static variable 'off_t_is_large' [-Wmissing-variable-declarations] warning: no previous prototype for 'check' [-Wmissing-prototypes] warning: no previous prototype for function 'check' [-Wmissing-prototypes] warning: null argument where non-null required (argument 2) [-Wnonnull] warning: passing 'const char[1]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] warning: passing argument 2 of 'SSL_CTX_set_srp_password' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] warning: passing argument 2 of 'SSL_CTX_set_srp_username' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] warning: unused parameter 'c' [-Wunused-parameter] warning: unused parameter 'f' [-Wunused-parameter] warning: unused variable 'data' [-Wunused-variable] warning: unused variable 'dummy' [-Wunused-variable] warning: unused variable 'flag' [-Wunused-variable] warning: unused variable 'res' [-Wunused-variable] warning: unused variable 's' [-Wunused-variable] warning: variable 's' set but not used [-Wunused-but-set-variable] warning: variable 'ts' set but not used [-Wunused-but-set-variable] ``` Closes #16287 |
||
|---|---|---|
| .circleci | ||
| .github | ||
| CMake | ||
| docs | ||
| include | ||
| lib | ||
| LICENSES | ||
| m4 | ||
| packages | ||
| plan9 | ||
| projects | ||
| scripts | ||
| src | ||
| tests | ||
| winbuild | ||
| .dir-locals.el | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitignore | ||
| .mailmap | ||
| acinclude.m4 | ||
| appveyor.sh | ||
| appveyor.yml | ||
| buildconf | ||
| CHANGES.md | ||
| CMakeLists.txt | ||
| configure.ac | ||
| COPYING | ||
| curl-config.in | ||
| Dockerfile | ||
| GIT-INFO.md | ||
| libcurl.pc.in | ||
| Makefile.am | ||
| README | ||
| README.md | ||
| RELEASE-NOTES | ||
| renovate.json | ||
| REUSE.toml | ||
| SECURITY.md | ||
curl is a command-line tool for transferring data specified with URL syntax. Learn how to use curl by reading the manpage or everything curl.
Find out how to install curl by reading the INSTALL document.
libcurl is the library curl is using to do its job. It is readily available to be used by your software. Read the libcurl manpage to learn how.
Open Source
curl is Open Source and is distributed under an MIT-like license.
Contact
Contact us on a suitable mailing list or use GitHub issues/ pull requests/ discussions.
All contributors to the project are listed in the THANKS document.
Commercial support
For commercial support, maybe private and dedicated help with your problems or applications using (lib)curl visit the support page.
Website
Visit the curl website for the latest news and downloads.
Source code
Download the latest source from the Git server:
git clone https://github.com/curl/curl.git
Security problems
Report suspected security problems via our HackerOne page and not in public.
Notice
curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan. This notice is included here to comply with the distribution terms.
Backers
Thank you to all our backers 🙏 Become a backer.
Sponsors
Support this project by becoming a sponsor.