Skip to content

Commit

Permalink
lib: feature deprecation warnings in gcc >= 4.3
Browse files Browse the repository at this point in the history
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
  • Loading branch information
monnerat authored and bagder committed Nov 15, 2022
1 parent 9805109 commit 6967571
Show file tree
Hide file tree
Showing 39 changed files with 771 additions and 243 deletions.
3 changes: 2 additions & 1 deletion docs/examples/Makefile.am
Expand Up @@ -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

Expand Down
9 changes: 6 additions & 3 deletions docs/libcurl/curl_easy_setopt.3
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/libcurl/opts/CURLOPT_CONV_FROM_NETWORK_FUNCTION.3
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/libcurl/opts/CURLOPT_CONV_FROM_UTF8_FUNCTION.3
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/libcurl/opts/CURLOPT_CONV_TO_NETWORK_FUNCTION.3
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.3
Expand Up @@ -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)"
3 changes: 3 additions & 0 deletions docs/libcurl/symbols-in-versions
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6967571

Please sign in to comment.