main: test_native_astc_texture_count does not compile on Windows (scanf is deprecated in the CRT; from #2288) #2396

Closed
opened 2026-11-11 17:15:16 +00:00 by mooki000 · 0 comments
mooki000 commented 2026-11-11 17:15:16 +00:00 (Migrated from github.com)

Hookshot version

main 696d85b0 (every main since fd16f15b, 2026-11-11 17:00 UTC), from source

What kind of problem

Something else

What happened

tests/test_native_astc_texture_count.py, the test that came with my #2288, does not compile on Windows, so the game-free checks fail there (Python source checks (windows-2022, part 1/2): 179 passed, 1 failed, 13 skipped):

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.
   13 |     while (std::scanf("%u %u %u %u %u", &w, &h, &d, &bw, &bh) == 5)

The fixture is compiled with -Wall -Wextra -Werror and reads its cases with std::scanf; with clang and the Windows CRT's headers that is a deprecation, and so an error. On Linux it passes with g++ and clang++, which is all I had run. #2288's own workflows never ran before the merge (they waited for an approval), so it first showed on a later pull request's run (#2289, this job).

Only the test's fixture is affected, not the game.

Where in the game

Not in the game: tests/run_all.py on Windows

How often

Every time

Graphics card and driver version

Does not depend on it

CPU, RAM and operating system

GitHub's windows-2022 runner (clang++ with the Windows SDK's headers); it passes on Arch Linux with g++ 16.2.1 and clang++ 23.1.3

Changes from the defaults

None

Other software hooked into the game

No, nothing hooked in

hookshot_log.txt

Not a game run. The job's log is linked above.

Claim

I'm working on this: one line in the test's fixture (_CRT_SECURE_NO_WARNINGS ahead of its includes, as the other test sources that use these functions have it), and its pull request follows this issue directly. By docs/workflow.md: S2 (main's checks are red on Windows for everyone) x reach (every contributor's run) x confidence: the cause is the compiler's own message; the fix is proven only when the pull request's Windows job passes, which I will confirm there.

### Hookshot version main 696d85b0 (every main since fd16f15b, 2026-11-11 17:00 UTC), from source ### What kind of problem Something else ### What happened `tests/test_native_astc_texture_count.py`, the test that came with my #2288, does not compile on Windows, so the game-free checks fail there (`Python source checks (windows-2022, part 1/2)`: 179 passed, 1 failed, 13 skipped): ``` 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. 13 | while (std::scanf("%u %u %u %u %u", &w, &h, &d, &bw, &bh) == 5) ``` The fixture is compiled with `-Wall -Wextra -Werror` and reads its cases with `std::scanf`; with clang and the Windows CRT's headers that is a deprecation, and so an error. On Linux it passes with g++ and clang++, which is all I had run. #2288's own workflows never ran before the merge (they waited for an approval), so it first showed on a later pull request's run (#2289, [this job](https://github.com/NotRexed/Hookshot/actions/runs/43065144550/job/130677975993)). Only the test's fixture is affected, not the game. ### Where in the game Not in the game: `tests/run_all.py` on Windows ### How often Every time ### Graphics card and driver version Does not depend on it ### CPU, RAM and operating system GitHub's windows-2022 runner (clang++ with the Windows SDK's headers); it passes on Arch Linux with g++ 16.2.1 and clang++ 23.1.3 ### Changes from the defaults None ### Other software hooked into the game No, nothing hooked in ### hookshot_log.txt Not a game run. The job's log is linked above. ### Claim I'm working on this: one line in the test's fixture (`_CRT_SECURE_NO_WARNINGS` ahead of its includes, as the other test sources that use these functions have it), and its pull request follows this issue directly. By `docs/workflow.md`: S2 (main's checks are red on Windows for everyone) x reach (every contributor's run) x confidence: the cause is the compiler's own message; the fix is proven only when the pull request's Windows job passes, which I will confirm there.
Commenting is not possible because the repository is archived.
No milestone
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Hookshot#2396
No description provided.