lib: feature deprecation warnings in gcc >= 4.3

Add a deprecated attribute to functions and enum values that should not
be used anymore.
This uses a gcc 4.3 dialect, thus is only available for this version of
gcc and newer. Note that the _Pragma() keyword is introduced by C99, but
is available as part of the gcc dialect even when compiling in C89 mode.

It is still possible to disable deprecation at a calling module compile
time by defining CURL_DISABLE_DEPRECATION.

Gcc type checking macros are made aware of possible deprecations.

Some testing support Perl programs are adapted to the extended
declaration syntax.

Several test and unit test C programs intentionally use deprecated
functions/options and are annotated to not generate a warning.

New test 1222 checks the deprecation status in doc and header files.

Closes #9667
This commit is contained in:
Patrick Monnerat 2022-11-14 15:21:34 +01:00 committed by Daniel Stenberg
parent 980510926d
commit 6967571bf2
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
39 changed files with 771 additions and 243 deletions

View file

@ -34,7 +34,8 @@ EXTRA_DIST = README.md Makefile.example Makefile.inc Makefile.m32 \
#
# $(top_srcdir)/include is for libcurl's external include files
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CPPFLAGS = -I$(top_srcdir)/include \
-DCURL_DISABLE_DEPRECATION
LIBDIR = $(top_builddir)/lib

View file

@ -126,11 +126,14 @@ Callback for SSL context logic. See \fICURLOPT_SSL_CTX_FUNCTION(3)\fP
.IP CURLOPT_SSL_CTX_DATA
Data pointer to pass to the SSL context callback. See \fICURLOPT_SSL_CTX_DATA(3)\fP
.IP CURLOPT_CONV_TO_NETWORK_FUNCTION
Callback for code base conversion. See \fICURLOPT_CONV_TO_NETWORK_FUNCTION(3)\fP
\fBOBSOLETE\fP Callback for code base conversion.
See \fICURLOPT_CONV_TO_NETWORK_FUNCTION(3)\fP
.IP CURLOPT_CONV_FROM_NETWORK_FUNCTION
Callback for code base conversion. See \fICURLOPT_CONV_FROM_NETWORK_FUNCTION(3)\fP
\fBOBSOLETE\fP Callback for code base conversion.
See \fICURLOPT_CONV_FROM_NETWORK_FUNCTION(3)\fP
.IP CURLOPT_CONV_FROM_UTF8_FUNCTION
Callback for code base conversion. See \fICURLOPT_CONV_FROM_UTF8_FUNCTION(3)\fP
\fBOBSOLETE\fP Callback for code base conversion.
See \fICURLOPT_CONV_FROM_UTF8_FUNCTION(3)\fP
.IP CURLOPT_INTERLEAVEFUNCTION
Callback for RTSP interleaved data. See \fICURLOPT_INTERLEAVEFUNCTION(3)\fP
.IP CURLOPT_INTERLEAVEDATA

View file

@ -96,7 +96,7 @@ curl_easy_setopt(curl, CURLOPT_CONV_FROM_NETWORK_FUNCTION,
my_conv_from_ascii_to_ebcdic);
.fi
.SH AVAILABILITY
Not available since 7.82.0
Not available and deprecated since 7.82.0.
Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was
built.

View file

@ -94,7 +94,7 @@ curl_easy_setopt(curl, CURLOPT_CONV_FROM_UTF8_FUNCTION,
my_conv_from_utf8_to_ebcdic);
.fi
.SH AVAILABILITY
Not available since 7.82.0
Not available and deprecated since 7.82.0.
Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was
built.

View file

@ -95,7 +95,7 @@ curl_easy_setopt(curl, CURLOPT_CONV_TO_NETWORK_FUNCTION,
my_conv_from_ebcdic_to_ascii);
.fi
.SH AVAILABILITY
Not available since 7.82.0
Not available and deprecated since 7.82.0.
Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was
built.

View file

@ -110,8 +110,9 @@ All
curl_easy_setopt(curl_handle, CURLOPT_PROGRESSFUNCTION, progress_callback);
.fi
.SH AVAILABILITY
Deprecated in 7.32.0.
Deprecated since 7.32.0.
.SH RETURN VALUE
Returns CURLE_OK.
.SH "SEE ALSO"
.BR CURLOPT_VERBOSE "(3), " CURLOPT_NOPROGRESS "(3), "
.BR CURLOPT_XFERINFOFUNCTION "(3)"

View file

@ -23,6 +23,7 @@ CURL_CHUNK_END_FUNC_OK 7.21.0
CURL_CSELECT_ERR 7.16.3
CURL_CSELECT_IN 7.16.3
CURL_CSELECT_OUT 7.16.3
CURL_DEPRECATED 7.87.0
CURL_DID_MEMORY_FUNC_TYPEDEFS 7.49.0
CURL_EASY_NONE 7.14.0 - 7.15.4
CURL_EASY_TIMEOUT 7.14.0 - 7.15.4
@ -61,6 +62,7 @@ CURL_HTTPPOST_PTRBUFFER 7.46.0
CURL_HTTPPOST_PTRCONTENTS 7.46.0
CURL_HTTPPOST_PTRNAME 7.46.0
CURL_HTTPPOST_READFILE 7.46.0
CURL_IGNORE_DEPRECATION 7.87.0
CURL_IPRESOLVE_V4 7.10.8
CURL_IPRESOLVE_V6 7.10.8
CURL_IPRESOLVE_WHATEVER 7.10.8
@ -886,6 +888,7 @@ CURLOPT_WS_OPTIONS 7.86.0
CURLOPT_XFERINFODATA 7.32.0
CURLOPT_XFERINFOFUNCTION 7.32.0
CURLOPT_XOAUTH2_BEARER 7.33.0
CURLOPTDEPRECATED 7.87.0
CURLOPTTYPE_BLOB 7.71.0
CURLOPTTYPE_CBPOINT 7.73.0
CURLOPTTYPE_FUNCTIONPOINT 7.1