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 to 5fc61a37c1 #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 to 0f10360073 #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:
Viktor Szakats 2024-09-05 02:11:35 +02:00
parent e1ab01d1bd
commit 5cefda1b93
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
13 changed files with 280 additions and 239 deletions

View file

@ -35,8 +35,7 @@ EXTRA_DIST = CMakeLists.txt
AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_builddir)/lib \
-I$(top_srcdir)/lib \
-DCURL_DISABLE_DEPRECATION
-I$(top_srcdir)/lib
LIBDIR = $(top_builddir)/lib