Skip to content

fix: Resolve compile-time warnings in first-party code#376

Open
andy5995 wants to merge 1 commit intodevelopfrom
fix/compile-warnings
Open

fix: Resolve compile-time warnings in first-party code#376
andy5995 wants to merge 1 commit intodevelopfrom
fix/compile-warnings

Conversation

@andy5995
Copy link
Copy Markdown
Collaborator

  • Fix logic bug in unit_type.cpp: dangling string expression was a no-op (missing desc += prefix); result was silently discarded
  • Fix -Wterminate in renderer.cpp: throwing from a destructor calls terminate() in C++11; log and swallow instead
  • Fix -Wformat-overflow in main.cpp (30 sites): NULL passed as %s argument to printf causes UB; replaced with ""
  • Fix -Wreorder in network_types.cpp and menu_state_root.cpp: member initializer order didn't match declaration order
  • Fix -Wswitch in 11 switch statements across commander.cpp, game.cpp, core_data.cpp, gui.cpp, unit_updater.cpp, client_interface.cpp, server_interface.cpp, network_message.cpp, menu_state_mods.cpp, and glest_map_editor (main.cpp, program.cpp): add default: break; for intentionally unhandled enum values

- Fix logic bug in unit_type.cpp: dangling string expression was a no-op
  (missing `desc +=` prefix); result was silently discarded
- Fix -Wterminate in renderer.cpp: throwing from a destructor calls
  terminate() in C++11; log and swallow instead
- Fix -Wformat-overflow in main.cpp (30 sites): NULL passed as %s
  argument to printf causes UB; replaced with ""
- Fix -Wreorder in network_types.cpp and menu_state_root.cpp: member
  initializer order didn't match declaration order
- Fix -Wswitch in 11 switch statements across commander.cpp, game.cpp,
  core_data.cpp, gui.cpp, unit_updater.cpp, client_interface.cpp,
  server_interface.cpp, network_message.cpp, menu_state_mods.cpp, and
  glest_map_editor (main.cpp, program.cpp): add `default: break;` for
  intentionally unhandled enum values

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant