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

Suppress GCC useless-cast warning from CHECK_THROWS_MATCHES #2904

Conversation

laudrup
Copy link
Contributor

@laudrup laudrup commented Sep 5, 2024

Suppress warning from GCC about useless cast in the CHECK_THROWS_MATCHES macro the same way it is already being done for the similar CHECK macros.

Suppress warning from GCC about useless cast in the
CHECK_THROWS_MATCHES macro the same way it is already being done for
the similar CHECK macros.
laudrup added a commit to laudrup/async-ssh that referenced this pull request Sep 5, 2024
Catch2 warns about a useless cast when using the CHECK_THROWS_MATCHES
macro.

This patch can hopefully be remove if my pull request is merged and a
newer version of Catch2 is released:

catchorg/Catch2#2904
Copy link

codecov bot commented Sep 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.90%. Comparing base (fa306fc) to head (1397c7b).
Report is 1 commits behind head on devel.

Additional details and impacted files
@@           Coverage Diff           @@
##            devel    #2904   +/-   ##
=======================================
  Coverage   90.90%   90.90%           
=======================================
  Files         199      199           
  Lines        8595     8595           
=======================================
  Hits         7813     7813           
  Misses        782      782           

@laudrup
Copy link
Contributor Author

laudrup commented Sep 5, 2024

CHECK_THROWS_MATCHES will generate a useless-cast warning when building with GCC. I assume this additional suppression was simply overseen when the changes 0de60d8 were added.

laudrup added a commit to laudrup/async-ssh that referenced this pull request Sep 5, 2024
Catch2 warns about a useless cast when using the CHECK_THROWS_MATCHES
macro.

This patch can hopefully be remove if my pull request is merged and a
newer version of Catch2 is released:

catchorg/Catch2#2904
@horenmar horenmar merged commit bc63412 into catchorg:devel Sep 6, 2024
77 checks passed
@horenmar
Copy link
Member

horenmar commented Sep 6, 2024

Thanks.

GerHobbelt added a commit to GerHobbelt/Catch2 that referenced this pull request Sep 27, 2024
v3.7.1

=== Improvements ===
* Applied the JUnit reporter's optimization from last release to the SonarQube reporter
* Suppressed `-Wuseless-cast` in `CHECK_THROWS_MATCHES` (catchorg#2904)
* Standardize exit codes for various failures
  * Running no tests is now guaranteed to exit with 2 (without the `--allow-running-no-tests` flag)
  * All tests skipped is now always 4 (...)
  * Assertion failures are now always 42
  * and so on

=== Fixes ===
* Fixed out-of-bounds access when the arg parser encounters single `-` as an argument (catchorg#2905)

=== Miscellaneous ===
* Added `catch_config_prefix_messages.hpp` to meson build (catchorg#2903)
* `catch_discover_tests` now supports skipped tests (catchorg#2873)
  * You can get the old behaviour by calling `catch_discover_tests` with `SKIP_IS_FAILURE` option.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEE8QyLZSqAHw/oZQgX3kgwe4sNOBoFAmbpQnMACgkQ3kgwe4sN
# OBpa1Q//UbNsxKpLU7cKzCr3kEOOc2RsryS5foHYRs+mhUzOFYf4y1HkSdvzc3TV
# ZUI8sA5FA1OVO7JtCSpgzizF5vGiOunDFGgroSw9kIxsX0KtHugksNgQcU7QeFEf
# 6KqtKb4/tmRryuyoHZTdWMxBGpB4dtc3zy1Yq+ebe8k52neBmilb80Mz9KbuQ4vT
# QAXz7xWiZukHyxosmKZe5kxDLF3Ck5iVCvvUJu9iwiE6Ua8TIJgs+sOFApsQztmu
# 5hwrmajqZGLB65RQe4G6AXScNLGnzRTJwByR5fg+YFZQmUdjSE0oQ6rd2Ni9qk5c
# QUOPBAVA2A3rahnV3k9bY6SapFjeTZlO4/go9eSzswc2CU7LCX0jRME5d+oW6YJ4
# H0XgacVYM362Exd4hKsSplfuvwkRi1irlnGxHpTvBLBp1czJgUnQV1lwsncaiQFx
# IZfxiqot+V0fPEweVkgHOwf175o9SLLZka6546MFgSvWY8yEEMnl3nLrmeHhCFPq
# 70MdKcj/Qbzkzd5PTSuUoUhxIFZJMzsszj9b0pdGlCb5ObRMcN0UHKG9nVNXWTmn
# tWnukCdzGHsZzaHjH/J0IY8P9ANNjAb5xtROzuF5TmE6h+D5J6kwxGTqZoCyqmC/
# FyPPf1WYkrU2qj+ms7SbdyGlE7s1w8VF/7p3/EKwoE2fpZk/9WM=
# =lDEO
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue Sep 17 10:48:51 2024 WEDT
# gpg:                using RSA key F10C8B652A801F0FE8650817DE48307B8B0D381A
# gpg: Can't check signature: No public key

# Conflicts:
#	README.md
#	conanfile.py
#	docs/release-notes.md
#	docs/tutorial.md
#	include/internal/catch_compiler_capabilities.h
#	include/internal/catch_debugger.h
#	include/internal/catch_evaluate.hpp
#	include/internal/catch_expression_lhs.hpp
#	include/internal/catch_fatal_condition.hpp
#	include/internal/catch_message.hpp
#	include/internal/catch_result_builder.hpp
#	include/internal/catch_run_context.hpp
#	include/internal/catch_test_case_registry_impl.hpp
#	include/reporters/catch_reporter_console.hpp
#	include/reporters/catch_reporter_teamcity.hpp
#	include/reporters/catch_reporter_xml.hpp
#	scripts/updateVcpkgPackage.py
#	single_include/catch.hpp
#	src/catch2/catch_version.cpp
#	test_package/conanfile.py
GlynLeine added a commit to Rythe-Interactive/Catch2 that referenced this pull request Oct 15, 2024
v3.7.1

=== Improvements ===
* Applied the JUnit reporter's optimization from last release to the SonarQube reporter
* Suppressed `-Wuseless-cast` in `CHECK_THROWS_MATCHES` (catchorg#2904)
* Standardize exit codes for various failures
  * Running no tests is now guaranteed to exit with 2 (without the `--allow-running-no-tests` flag)
  * All tests skipped is now always 4 (...)
  * Assertion failures are now always 42
  * and so on

=== Fixes ===
* Fixed out-of-bounds access when the arg parser encounters single `-` as an argument (catchorg#2905)

=== Miscellaneous ===
* Added `catch_config_prefix_messages.hpp` to meson build (catchorg#2903)
* `catch_discover_tests` now supports skipped tests (catchorg#2873)
  * You can get the old behaviour by calling `catch_discover_tests` with `SKIP_IS_FAILURE` option.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEE8QyLZSqAHw/oZQgX3kgwe4sNOBoFAmbpQnMACgkQ3kgwe4sN
# OBpa1Q//UbNsxKpLU7cKzCr3kEOOc2RsryS5foHYRs+mhUzOFYf4y1HkSdvzc3TV
# ZUI8sA5FA1OVO7JtCSpgzizF5vGiOunDFGgroSw9kIxsX0KtHugksNgQcU7QeFEf
# 6KqtKb4/tmRryuyoHZTdWMxBGpB4dtc3zy1Yq+ebe8k52neBmilb80Mz9KbuQ4vT
# QAXz7xWiZukHyxosmKZe5kxDLF3Ck5iVCvvUJu9iwiE6Ua8TIJgs+sOFApsQztmu
# 5hwrmajqZGLB65RQe4G6AXScNLGnzRTJwByR5fg+YFZQmUdjSE0oQ6rd2Ni9qk5c
# QUOPBAVA2A3rahnV3k9bY6SapFjeTZlO4/go9eSzswc2CU7LCX0jRME5d+oW6YJ4
# H0XgacVYM362Exd4hKsSplfuvwkRi1irlnGxHpTvBLBp1czJgUnQV1lwsncaiQFx
# IZfxiqot+V0fPEweVkgHOwf175o9SLLZka6546MFgSvWY8yEEMnl3nLrmeHhCFPq
# 70MdKcj/Qbzkzd5PTSuUoUhxIFZJMzsszj9b0pdGlCb5ObRMcN0UHKG9nVNXWTmn
# tWnukCdzGHsZzaHjH/J0IY8P9ANNjAb5xtROzuF5TmE6h+D5J6kwxGTqZoCyqmC/
# FyPPf1WYkrU2qj+ms7SbdyGlE7s1w8VF/7p3/EKwoE2fpZk/9WM=
# =lDEO
# -----END PGP SIGNATURE-----
# gpg: directory '/c/Users/Ty Rymer/.gnupg' created
# gpg: Signature made Tue Sep 17 10:48:51 2024 WEST
# gpg:                using RSA key F10C8B652A801F0FE8650817DE48307B8B0D381A
# gpg: Can't check signature: No public key
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