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

Rename template parameter names to avoid name conflict on Solaris. #1723

Merged
merged 1 commit into from
Aug 10, 2019
Merged

Rename template parameter names to avoid name conflict on Solaris. #1723

merged 1 commit into from
Aug 10, 2019

Conversation

jealas
Copy link
Contributor

@jealas jealas commented Aug 9, 2019

Closes #1722

This PR fixes a compilation issue on Solaris 11.4 with GCC 7.3.0 on the latest Catch2 master branch. A #define in the Solaris 11.4 <sys/regset.h> header conflicts with a template parameter name used in catch_tostring.h and it gets renamed to an integer constant. This causes an obvious compilation issue. Please refer to the issue for more details about the bug.

The bug is simply fixed by re-naming the 'SS' template parameter name to something more descriptive like 'Stream'. I also took the liberty of renaming the template parameter name 'TT' to 'U' because I saw the template parameter name 'U' used throughout the codebase and couldn't find any other "same double letter" names used.

After making this change, I can confirm that Catch2 compiles and builds with the main.cpp file detailed in the issue, with a non-trivial project and with the Catch2 SelfTest target on Solaris 11.4.

@codecov
Copy link

codecov bot commented Aug 9, 2019

Codecov Report

Merging #1723 into master will increase coverage by 2.63%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1723      +/-   ##
==========================================
+ Coverage    84.4%   87.03%   +2.63%     
==========================================
  Files         123      136      +13     
  Lines        3487     5275    +1788     
==========================================
+ Hits         2943     4591    +1648     
- Misses        544      684     +140

@jealas
Copy link
Contributor Author

jealas commented Aug 9, 2019

SelfTest ran successfully on Solaris 11.4 with: All tests passed (1395 assertions in 219 test cases).

@horenmar horenmar added the Tweak label Aug 10, 2019
@horenmar
Copy link
Member

Yet another example of why the C macros were a terrible idea.

Thanks for the fix.

@horenmar horenmar merged commit 378cc1a into catchorg:master Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Catch2 does not compile on Solaris.
2 participants