-
Notifications
You must be signed in to change notification settings - Fork 543
CXX-3088 fix build with GCC 4.8.5 #1194
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
CXX-3088 fix build with GCC 4.8.5 #1194
Conversation
Resolves error: "redeclaration [...] differs in 'constexpr'"
Resolves error: "missing space between '""' and suffix identifier"
gcc 4.8.5 does not recognize.
Resolves warnings (causing errors) addressed in CDRIVER-5673. Upgrading C driver to get fix results in test failures due to removal of "rangePreview" algorithm.
Shouldn't FetchMongoC.cmake be preventing warnings-as-errors when building the C Driver from source? |
C driver is already built with `-Werror` removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Building the C driver resulted in errors due to unused-parameter warnings: [...]
Shouldn't FetchMongoC.cmake be preventing warnings-as-errors when building the C Driver from source?
Good spot. The errors were from the C++ driver building C driver headers. I reverted changes to cc_flags
, but kept the cxx_flags
.
Verified with this patch: https://spruce.mongodb.com/version/66c63bc0968aff00077889c3
Summary
Fix build with GCC 4.8.5.
Verified with this patch build.
Description
Supporting build with GCC 4.8.5 is motivated by a request to build on a customer RHEL 7.9 system. See slack thread.
This PR resolves errors observed when building with RHEL 7 with GCC 4.8.5.
Error: redeclaration differs in 'constexpr'
I expect this is a quirk in old GCC. See: https://stackoverflow.com/a/17074539/774658. This PR adds
constexpr
to match.Error: missing space
This PR adds a space for C++11 compliance.
C++11 user-defined literals note a space is required:
C++14 user-defined literals permit no space:
Ignoring unused parameters
Building the C driver resulted in errors due to
unused-parameter
warnings:This was addressed in CDRIVER-5673. However, trying to upgrade the C driver to include the fix resulted in test failures in In-Use Encryption tests due to "rangePreview" being removed. I expect the In-Use Encryption test updates will be addressed in CXX-3014. To limit scope of this PR,
-Wno-unused-parameter
is added to compile flags on RHEL 7 as a temporary workaround until the C driver is upgraded to include CDRIVER-5673.