Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with the conformant preprocessor, improve validator #4886

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

StephanTLavavej
Copy link
Member

/std:c++latest implies /permissive- but not /Zc:preprocessor, so we have to manually enable it.

  • Build the STL, benchmarks, and validator with the conformant preprocessor.
    • I've verified that the compiler option is active in each directory.
  • Drop "we use SAL annotations" comment.
  • Use _wfopen_s() instead of defining _CRT_SECURE_NO_WARNINGS.
    • Also avoid crashing in ~BinaryFile() if the file wasn't successfully opened.
    • Note that m_file already has a data member initializer, so it's null before we call _wfopen_s().

…ssor.

I've verified that the compiler option is active in each directory.
This was added by GH 2671 on 2022-05-01, then `_Printf_format_string_` was removed by GH 3919 on 2023-08-03.

We can keep using `/analyze`, though. It adds ~4.5 seconds on my machine, but it's not part of the dev inner loop, and Code Format Validation isn't on the critical path (the Early Builds take longer).
Also avoid crashing in `~BinaryFile()` if the file wasn't successfully opened.
@StephanTLavavej StephanTLavavej added infrastructure Related to repository automation build Related to the build system labels Aug 10, 2024
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner August 10, 2024 14:20
@StephanTLavavej StephanTLavavej merged commit 6c94f4e into microsoft:main Aug 12, 2024
39 checks passed
@StephanTLavavej StephanTLavavej deleted the improve-build branch August 12, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to the build system infrastructure Related to repository automation
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants