CXX-3088 fix build with GCC 4.8.5#1194
Merged
kevinAlbs merged 6 commits intomongodb:masterfrom Sep 3, 2024
Merged
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.
eramongodb
reviewed
Aug 21, 2024
Contributor
Shouldn't FetchMongoC.cmake be preventing warnings-as-errors when building the C Driver from source? |
C driver is already built with `-Werror` removed.
kevinAlbs
commented
Aug 21, 2024
Collaborator
Author
There was a problem hiding this comment.
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
eramongodb
approved these changes
Aug 21, 2024
adriandole
approved these changes
Sep 3, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
constexprto 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-parameterwarnings: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-parameteris added to compile flags on RHEL 7 as a temporary workaround until the C driver is upgraded to include CDRIVER-5673.