Replace old-style casts#2
Merged
Merged
Conversation
The warning flags are GNU-style, and MSVC's cl.exe rejects them with a hard error (D8021) rather than ignoring them. Since remfile-cpp is consumed via FetchContent, that would break any downstream Windows build, so the flags are now set only for non-MSVC compilers. The list is hoisted into a variable shared by the library and plugin targets. CI additionally configures with CMAKE_COMPILE_WARNING_AS_ERROR=ON so new warnings fail the build there, while local and downstream builds keep warnings non-fatal to stay robust against future compiler versions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
|
Thanks @oruebel, the cast replacements all look good and build cleanly for me locally. I pushed one commit on top: the warning flags are GNU-style, and MSVC's cl.exe rejects them with a hard error rather than ignoring them. Since remfile-cpp is consumed via FetchContent, that would break any downstream Windows build, so the flags are now guarded behind if(NOT MSVC) and shared between the library and plugin targets through a variable. I also enabled CMAKE_COMPILE_WARNING_AS_ERROR=ON in the CI configure steps so the warnings you enabled actually gate merges going forward, while keeping warnings non-fatal in the default build so a future compiler version cannot break downstream consumers. I'll merge once CI is green. |
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.
Fix #1
build: enable -Wall, -Wextra, -Wold-style-cast, and -Wsign-conversion;and mark CURL as SYSTEM include to suppress warnings from external includes that are outside of remfile-cpp's control