Repository navigation
test: test_native_astc_texture_count builds on Windows, where the CRT marks scanf deprecated - #2397
Merged
hckrman101 merged 1 commit intoNov 11, 2026
Conversation
… marks scanf deprecated The test from NotRexed#2288 compiles its fixture with -Wall -Wextra -Werror and reads its cases with std::scanf. With clang and the Windows CRT's headers scanf is marked deprecated, so the fixture does not compile there and the game-free checks fail on windows-2022 (part 1/2): fixture.cpp:13:17: error: 'scanf' is deprecated: This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. NotRexed#2288's own workflows had not run before it was merged (they waited for an approval), so this was first seen on a later pull request's run. The fixture now defines _CRT_SECURE_NO_WARNINGS ahead of its includes, as the other test sources that use these functions do. Nothing else changes. Assisted-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Thanks for the review. Confirmed from this head’s Windows part 1/2 log: |
This was referenced Nov 11, 2026
Contributor
|
Testing pass on
|
This was referenced Nov 11, 2026
Merged
Merged
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.
What this is for: main's game-free checks pass on Windows again. The test that came with my #2288 does not compile there, so
Python source checks (windows-2022, part 1/2)fails on every run since that merge. What is measured: the test with g++ and clang++ on Linux, on this branch. Not measured: Windows on my side: I have no Windows machine, so this pull request's own windows-2022 job is the proof, and I will confirm its result here.Problem
tests/test_native_astc_texture_count.pycompiles a small fixture with-Wall -Wextra -Werrorand reads its cases withstd::scanf. With clang and the Windows CRT's headersscanfis marked deprecated, which-Werrormakes an error:What changed
tests/test_native_astc_texture_count.py: the fixture defines_CRT_SECURE_NO_WARNINGSahead of its includes, as the other test sources that use these functions do (tests/capture_dimensions_test.cpp,tests/png_publication_test.cppand others). One line; no assertion, case or source file changes.How it was tested
Arch Linux, g++ 16.2.1 and clang++ 23.1.3, branch head
fc0157a1on main696d85b0:python -I -B tests/test_native_astc_texture_count.py --cxx g++and--cxx clang++:native ASTC texture count: 182 cases pass, as before the change.Not tested
Risks
Fixes #2396.
Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com