Skip to content

build: tidy up deprecation suppression, enable warnings for clang#14789

Closed
vszakats wants to merge 15 commits intocurl:masterfrom
vszakats:cm-deprec-api
Closed

build: tidy up deprecation suppression, enable warnings for clang#14789
vszakats wants to merge 15 commits intocurl:masterfrom
vszakats:cm-deprec-api

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Sep 5, 2024

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 5fc61a3 examples: suppress deprecation warnings locally #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 0f10360 test1545: disable deprecation warnings #12444

  • libtest, unit: replace CURL_DISABLE_DEPRECATION with
    CURL_IGNORE_DEPRECATION().

  • docs/examples: replace pragmas with CURL_IGNORE_DEPRECATION().


w/o whitespace: https://github.com/curl/curl/pull/14789/files?w=1

@vszakats vszakats changed the title build: tidy up CURL_DISABLE_DEPRECATION uses build: tidy up CURL_DISABLE_DEPRECATION use Sep 5, 2024
@github-actions github-actions bot added the tests label Sep 5, 2024
@vszakats vszakats changed the title build: tidy up CURL_DISABLE_DEPRECATION use build: tidy up deprecation suppression, add warnings for clang, MSVC Sep 5, 2024
@vszakats vszakats marked this pull request as draft September 5, 2024 02:27
@vszakats vszakats changed the title build: tidy up deprecation suppression, add warnings for clang, MSVC build: tidy up deprecation suppression, enable warnings for clang Sep 5, 2024
@vszakats vszakats marked this pull request as ready for review September 5, 2024 19:07
@vszakats
Copy link
Member Author

vszakats commented Sep 5, 2024

Tried to enable deprecation warnings for MSVC, but it fell over because CURL_DEPRECATED() is also used in enums which is apparently unsupported by it.

@vszakats vszakats closed this in 5cefda1 Sep 20, 2024
@vszakats vszakats deleted the cm-deprec-api branch September 20, 2024 23:04
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
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 5fc61a3 curl#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 0f10360 curl#12444

- libtest, unit: replace `CURL_DISABLE_DEPRECATION` with
  `CURL_IGNORE_DEPRECATION()`.

- docs/examples: replace pragmas with `CURL_IGNORE_DEPRECATION()`.

Closes curl#14789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant