Skip to content

Fix Windows clang++ CI failure in maxpos sample by guarding CRT deprecation warnings - #1

Draft
LLaammTTeerr with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-github-actions-job-clang-windows
Draft

Fix Windows clang++ CI failure in maxpos sample by guarding CRT deprecation warnings#1
LLaammTTeerr with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-github-actions-job-clang-windows

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown

The Use clang++ on windows-2022 job failed during the compile sweep because docs/examples/maxpos/sol-correct.cpp uses scanf, which is treated as deprecated under MSVC CRT and escalated by -Werror. This change removes that toolchain-specific failure without changing runtime behavior.

  • Root cause

    • Windows clang++ (MSVC CRT) emits deprecated-CRT warnings for scanf in sol-correct.cpp; CI compiles with warnings-as-errors.
  • Change

    • Added an MSVC-only preprocessor guard in docs/examples/maxpos/sol-correct.cpp:
      • defines _CRT_SECURE_NO_WARNINGS before including <cstdio>
    • Scope is intentionally local to the sample file that failed.
  • Behavioral impact

    • No logic/path/output changes.
    • Only affects compile-time warning policy on MSVC-based toolchains.
#if defined(_MSC_VER)
#define _CRT_SECURE_NO_WARNINGS
#endif

#include <cstdio>

Copilot AI changed the title [WIP] Fix failing GitHub Actions job Use clang++ on windows-2022 Fix Windows clang++ CI failure in maxpos sample by guarding CRT deprecation warnings Jul 27, 2026
Copilot AI requested a review from LLaammTTeerr July 27, 2026 09:52
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.

2 participants