mirror of
https://github.com/curl/curl.git
synced 2026-08-02 01:50:32 +03:00
build: tidy up deprecation suppression, enable warnings for clang
Suppress deprecation warnings the closest to the deprecated code, using `CURL_IGNORE_DEPRECATION()`. Then drop build-specific suppressions, and file-wide ones. The latter is not compatible with Unity mode. Also replace manual suppressions with a macro to apply to all compilers with deprecation warning support. Also enable deprecation warnings for clang. - curl/curl.h: enable deprecation warnings for clang. - docs/examples: stop setting `CURL_DISABLE_DEPRECATION` with autotools. Suppression moved to C-level earlier. Syncs with cmake. Follow-up to5fc61a37c1#14123 - tests/http/clients: stop setting `CURL_DISABLE_DEPRECATION` in autotools. If it becomes necessary in the future, it can be done in C via the macro. Syncs with cmake. - lib1545: stop setting `CURL_DISABLE_DEPRECATION` in autotools. Drop guard from test source. Follow-up to0f10360073#12444 - libtest, unit: replace `CURL_DISABLE_DEPRECATION` with `CURL_IGNORE_DEPRECATION()`. - docs/examples: replace pragmas with `CURL_IGNORE_DEPRECATION()`. Closes #14789
This commit is contained in:
parent
e1ab01d1bd
commit
5cefda1b93
13 changed files with 280 additions and 239 deletions
|
|
@ -34,10 +34,11 @@
|
|||
#endif
|
||||
|
||||
/* Compile-time deprecation macros. */
|
||||
#if (defined(__GNUC__) && \
|
||||
((__GNUC__ > 12) || ((__GNUC__ == 12) && (__GNUC_MINOR__ >= 1 ))) || \
|
||||
defined(__IAR_SYSTEMS_ICC__)) && \
|
||||
!defined(__INTEL_COMPILER) && \
|
||||
#if (defined(__GNUC__) && \
|
||||
((__GNUC__ > 12) || ((__GNUC__ == 12) && (__GNUC_MINOR__ >= 1))) || \
|
||||
(defined(__clang__) && __clang_major__ >= 3) || \
|
||||
defined(__IAR_SYSTEMS_ICC__)) && \
|
||||
!defined(__INTEL_COMPILER) && \
|
||||
!defined(CURL_DISABLE_DEPRECATION) && !defined(BUILDING_LIBCURL)
|
||||
#define CURL_DEPRECATED(version, message) \
|
||||
__attribute__((deprecated("since " # version ". " message)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue