Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warning suppressions leaking under clang.exe #2280

Merged

Conversation

jorgenpt
Copy link

Description

When running clang.exe under Windows, catch.hpp leaks warning
suppressions because it uses #pragma warning(push) & #pragma warning(pop) around warning suppressions like #pragma clang diagnostic ignore "-Wunused-variable", instead of using #pragma clang diagnostic push and #pragma clang diagnostic pop.

This fixes that by only defining
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION and
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION to be the cl.exe variants if
defined(_MSC_VER) && !defined(__clang__).

When running clang.exe under Windows, catch.hpp leaks warning
suppressions because it uses `#pragma warning(push)` & `#pragma
warning(pop)` around warning suppressions like `#pragma clang diagnostic
ignore "-Wunused-variable"`, instead of using `#pragma clang diagnostic
push` and `#pragma clang diagnostic pop`.

This fixes that by only defining
`CATCH_INTERNAL_START_WARNINGS_SUPPRESSION` and
`CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION` to be the cl.exe variants if
`defined(_MSC_VER) && !defined(__clang__)`.
@codecov
Copy link

codecov bot commented Aug 28, 2021

Codecov Report

Merging #2280 (13e7cad) into v2.x (c4e3767) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             v2.x    #2280   +/-   ##
=======================================
  Coverage   90.09%   90.09%           
=======================================
  Files         113      113           
  Lines        5035     5035           
=======================================
  Hits         4536     4536           
  Misses        499      499           

@horenmar
Copy link
Member

Thanks

@horenmar horenmar merged commit 4b97802 into catchorg:v2.x Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants