Issue #798: Enable warnings as errors for Core for windows.#809
Open
rmpowell77 wants to merge 5 commits into
Open
Issue #798: Enable warnings as errors for Core for windows.#809rmpowell77 wants to merge 5 commits into
rmpowell77 wants to merge 5 commits into
Conversation
64ff72c to
736f638
Compare
0554a75 to
dd8b993
Compare
b4e4055 to
20f0038
Compare
Fix all MSVC C4244 build warnings and enable warnings as errors This comprehensive fix addresses all C4244 narrowing conversion warnings across the codebase and enables warnings-as-errors for all targets. Major changes: - Enable warnings-as-errors compiler flags (MSVC /WX, GCC/Clang -Werror) - Fix pragma warnings: add GCC/Clang pragmas, fix MSVC pragma syntax - Fix missing return statements in operator<=> and Animation::GetVariables - Add [[nodiscard]] attributes where return values should not be ignored - Remove unused variables and parameters throughout codebase - Initialize struct members in CalChartAnimationCommand to prevent warnings - Add explicit static_cast for narrowing conversions (float→unsigned, double→int, size_t casts) - Add SetVarValue(double) overload to minimize casts in continuity code - Fix SetupInstruments iterator to work with std::ranges::subrange - Add explicit float casts in CalChartPrintShowToPS for double→float conversions Files modified (23 files): - cmake/compiler.cmake: Enable /WX and -Werror - core/CalChartAnimation.cpp: Fix operator<=> return - core/CalChartAnimationCommand.h: Initialize struct members - core/CalChartAnimationCompile.h/cpp: Add SetVarValue(double) overload - core/CalChartConfiguration.cpp: static_cast Radian values to float - core/CalChartPoint.cpp: Integer division for radius calculations - core/CalChartPrintShowToPS.cpp: Explicit float casts for coordinate conversions - core/CalChartSheet.cpp: static_cast std::distance results - core/CalChartAnimationSheet.cpp: static_cast std::distance results - core/e7_transition_solver.cpp: static_cast for SolverCoord conversions - core/viewer_translate.cpp: static_cast angle return to float - src/animate.cpp: Remove unused parameters - src/BackgroundImages.cpp: Add GCC/Clang pragmas for -Wimplicit-fallthrough - src/CalChartDrawPrimitivesHelper.cpp: Add [[nodiscard]], fix pragma syntax - src/CalChartFrame.cpp: Remove unused variables - src/CalChartView.cpp: Add GCC/Clang pragmas - src/ContinuityBrowserPanel.cpp: Remove unused variables - src/FieldView.cpp: Fix GetVariables() return statement - src/PreferencesContCellSetup.cpp: Remove unused parameter - src/SetupInstruments.cpp: Fix iterator traits for std::ranges::subrange - src/modes/CalChartModeDrawing.cpp: Remove unused variables - src/modes/CalChartModeEdit_ManipulatePointsHelper.cpp: Remove unused variables All tests pass. No warnings in macOS build (Clang). Ready for Windows CI validation. Providing different levels to the warnings as errors.
- Linux GCC: Add pragma to suppress false positive -Wmaybe-uninitialized on structured bindings - Windows MSVC: Fix C4244 narrowing conversions with explicit casts - Windows MSVC: Fix C4267 size_t to int conversions - Windows MSVC: Suppress C4996 unsafe function warnings for gmtime/ctime - Windows MSVC: Guard Clang-specific #pragma mark with #ifdef - All platforms: Add static_cast for double/float conversions
Add missing 'f' suffix to lines 771-776 in ValueDefined::Get() mapping
Windows MSVC fixes: - CalChartAnimationSheet.cpp: Cast whichSheet to int for GetSheetName - CalChartSheet.cpp: Cast enumerate index to int for GenerateCurve - CalChartShow.cpp: Cast GetCurrentSheetNum() to int - CalChartPrintShowToPS.cpp: Add static_cast<float> for all DPI calculations - e7_transition_solver.cpp: Cast int division to float Linux GCC fixes: - CalChartContinuityToken.cpp: Suppress -Wnonnull false positive in vector<byte> operations
e2410ad to
f94ced7
Compare
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 all MSVC C4244 build warnings and enable warnings as errors
This comprehensive fix addresses all C4244 narrowing conversion warnings across the codebase and enables warnings-as-errors for all targets.
Major changes:
Files modified (23 files):
All tests pass. No warnings in macOS build (Clang). Ready for Windows CI validation.