Add explicit includes for transitively-used std headers - #348
Merged
Conversation
The Copilot review on dds_c_api_test.cpp flagged std::snprintf used without including <cstdio> (only <cstring> was present). Fixed that, then swept the rest of the project's own sources with clang-tidy's misc-include-cleaner check (via the repo's compile_commands.json) to find other symbols relied on only through transitive includes. Findings were filtered to genuine standard-library headers only, excluding project facade headers (e.g. api/dll.h, utility/constants.h) that are intentionally re-exported by dds_c_api.h and friends. Purely additive; no behavior changes. bazel build //... and bazel test //... both pass (186 targets, 86 tests). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QAt1cNBrEPkr8SqgAPMR73
Contributor
There was a problem hiding this comment.
Pull request overview
Adds explicit standard-library includes across DDS core, tests, utilities, Python bindings, and benchmarks, including the missing <cstdio> for std::snprintf.
Changes:
- Adds missing standard headers to 58 C++ sources.
- Covers core solver, transposition tables, system utilities, tests, bindings, and benchmarks.
- No runtime behavior changes; build and test results are reported clean.
Reviewed changes
Copilot reviewed 58 out of 58 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| utilities/tests/dd_table_for_deal_test.cpp | Updated as part of this pull request. |
| utilities/src/dd_table_for_deal/dd_table_for_deal_lib.cpp | Updated as part of this pull request. |
| python/src/converters.cpp | Updated as part of this pull request. |
| python/src/bindings.cpp | Updated as part of this pull request. |
| library/tests/trans_table/trans_table_s_test.cpp | Updated as part of this pull request. |
| library/tests/trans_table/trans_table_l_test.cpp | Updated as part of this pull request. |
| library/tests/trans_table/trans_table_base_test.cpp | Updated as part of this pull request. |
| library/tests/trans_table/test_utilities.cpp | Updated as part of this pull request. |
| library/tests/trans_table/mock_data_generators.cpp | Updated as part of this pull request. |
| library/tests/TestTimer.cpp | Updated as part of this pull request. |
| library/tests/testcommon.cpp | Updated as part of this pull request. |
| library/tests/test_timer_test.cpp | Updated as part of this pull request. |
| library/tests/system/parallel_boards_test.cpp | Updated as part of this pull request. |
| library/tests/solve_board/analyse_play_consistency.cpp | Updated as part of this pull request. |
| library/tests/report_board_timings.cpp | Updated as part of this pull request. |
| library/tests/report_board_timings_test.cpp | Updated as part of this pull request. |
| library/tests/regression/heuristic_sorting/heuristic_sorting_test.cpp | Updated as part of this pull request. |
| library/tests/print.cpp | Updated as part of this pull request. |
| library/tests/parse.cpp | Updated as part of this pull request. |
| library/tests/moves/moves_test.cpp | Updated as part of this pull request. |
| library/tests/loop.cpp | Updated as part of this pull request. |
| library/tests/loop_par_test.cpp | Updated as part of this pull request. |
| library/tests/heuristic_sorting/test_utils.cpp | Updated as part of this pull request. |
| library/tests/heuristic_sorting/minimal_weight_test.cpp | Updated as part of this pull request. |
| library/tests/dtest.cpp | Updated as part of this pull request. |
| library/tests/dtest_parallel.cpp | Updated as part of this pull request. |
| library/tests/dds_c_api_test.cpp | Updated as part of this pull request. |
| library/tests/args.cpp | Updated as part of this pull request. |
| library/tests/args_test.cpp | Updated as part of this pull request. |
| library/tests/ab_search/tt_lookup_test.cpp | Updated as part of this pull request. |
| library/tests/ab_search/make3_test.cpp | Updated as part of this pull request. |
| library/src/trans_table/trans_table_s.cpp | Updated as part of this pull request. |
| library/src/trans_table/trans_table_l.cpp | Updated as part of this pull request. |
| library/src/system/timer.cpp | Updated as part of this pull request. |
| library/src/system/timer_list.cpp | Updated as part of this pull request. |
| library/src/system/timer_group.cpp | Updated as part of this pull request. |
| library/src/system/time_stat.cpp | Updated as part of this pull request. |
| library/src/system/thread_mgr.cpp | Updated as part of this pull request. |
| library/src/system/thread_data.cpp | Updated as part of this pull request. |
| library/src/system/system.cpp | Updated as part of this pull request. |
| library/src/system/scheduler.cpp | Updated as part of this pull request. |
| library/src/system/parallel_boards.cpp | Updated as part of this pull request. |
| library/src/system/memory.cpp | Updated as part of this pull request. |
| library/src/system/file.cpp | Updated as part of this pull request. |
| library/src/solver_if.cpp | Updated as part of this pull request. |
| library/src/solver_context/solver_context.cpp | Updated as part of this pull request. |
| library/src/solve_board.cpp | Updated as part of this pull request. |
| library/src/play_analyser.cpp | Updated as part of this pull request. |
| library/src/later_tricks.cpp | Updated as part of this pull request. |
| library/src/init.cpp | Updated as part of this pull request. |
| library/src/dump.cpp | Updated as part of this pull request. |
| library/src/dds_api.cpp | Updated as part of this pull request. |
| library/src/ab_stats.cpp | Updated as part of this pull request. |
| library/src/ab_search.cpp | Updated as part of this pull request. |
| benchmarks/warm_tt_benchmark.cpp | Updated as part of this pull request. |
| benchmarks/replay.cpp | Updated as part of this pull request. |
| benchmarks/recording.cpp | Updated as part of this pull request. |
| benchmarks/dds_replay_main.cpp | Updated as part of this pull request. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
tameware
approved these changes
Aug 23, 2026
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
dds_c_api_test.cppflaggedstd::snprintfused without including<cstdio>(only<cstring>was present) — fixed.clang-tidy'smisc-include-cleanercheck (via the repo'scompile_commands.json) to find other symbols relied on only through transitive includes.api/dll.h,utility/constants.h) that are intentionally re-exported bydds_c_api.hand friends.Test plan
bazel build //...— all 186 targets build cleanbazel test //...— all 86 tests pass🤖 Generated with Claude Code
closes #329