0% found this document useful (0 votes)
136 views

Recommended Tools, Compilers and Options For x86, x64 and ARM

The document recommends optimal compilers, tools, and options for unmanaged and managed code development on x86/x64/ARM platforms. For unmanaged C/C++ code, it recommends using Visual Studio 2013 or newer with various security and code analysis switches enabled. It also recommends protecting against heap corruption, and fixing C4700 and C4701 compiler warnings. For managed C# code, it recommends Visual Studio 2013 or newer and .NET Framework 4.6.2 or newer.

Uploaded by

Luis Morales
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views

Recommended Tools, Compilers and Options For x86, x64 and ARM

The document recommends optimal compilers, tools, and options for unmanaged and managed code development on x86/x64/ARM platforms. For unmanaged C/C++ code, it recommends using Visual Studio 2013 or newer with various security and code analysis switches enabled. It also recommends protecting against heap corruption, and fixing C4700 and C4701 compiler warnings. For managed C# code, it recommends Visual Studio 2013 or newer and .NET Framework 4.6.2 or newer.

Uploaded by

Luis Morales
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Recommended Compilers, Tools, and Options

for x86/x64/ARM
Unmanaged Code

Compiler/ Minimum Recommended Version Optimal Recommended Version and


Tool and Switches/Options Switches/Options

C/C++ Microsoft Visual Studio 2012 Microsoft Visual Studio 2013 or newer
Compiler

cl.exe Use default switches/options - all Use default switches/options - all


previously-recommended security previously-recommended security
options are enabled by default options are enabled by default
Add /GUARD:CF (off by default)
Add /SDL

Link.exe Use default switches/options - all Use default switches/options - all


previously-recommended security previously-recommended security
options are enabled by default options are enabled by default

Additional steps may be taken to ensure


dependencies do not disable options
such as /SAFESEH, /NXCOMPAT,
/DYNAMICBASE, and
/HIGHENTROPYVA

MIDL.exe Use /robust Use /robust

Source code Visual Studio 2012 Code Analysis Visual Studio 2012 Code Analysis
analysis Options (“/analyze”) Options (“/analyze”).
For Visual Studio 2012 code For Visual Studio 2012 code analysis,
analysis, all warning IDs from the all warning IDs from the following list
following list should be fixed: 4532 should be fixed: 4532 6029 6053 6057
6029 6053 6057 6059 6063 6067 6059 6063 6067 6200 6201 6202 6203
6200 6201 6202 6203 6204 6248 6204 6248 6259 6260 6268 6276 6277
6259 6260 6268 6276 6277 6281 6281 6282 6287 6288 6289 6290 6291
6282 6287 6288 6289 6290 6291 6296 6298 6299 6305 6306 6308 6334
6296 6298 6299 6305 6306 6308 6383
6334 6383 Standard Annotation Language (SAL):
Code annotated with SAL should
correct additional warnings in addition
to those listed above. See SDL Standard
Annotation Language (SAL)
Recommendations for Native Win32
Code for more information. The
warnings are summarized as follows:
SAL Compliance
Visual Studio 2012: 26020 - 26023
/analyze
Visual Studio 2012: 6029 6053 6057
6059 6063 6067- 6201-6202 6248 6260
6276 6277 6305

Protecting n/a All executable programs written using


Against unmanaged code (.EXE) should call the
Heap HeapSetInformation interface.
Corruption See Heap Manager Fail Fast Setting for
more information.

C4700 and n/a Compile code with C4700 and C4701


C4701 compiler warnings enabled and fix all
Compiler instances of these warnings.
Warnings

Managed Code

Optimal Recommended
Compiler/ Minimum Recommended Version and
Version and
Tool Switches/Options
Switches/Options

C# Compiler Microsoft Visual Studio 2012 Microsoft Visual Studio 2013


or newer

.NET Version 4.5.2 with the SchUseStrongCrypto Version 4.6.2 or newer


Framework regkey set (needed for TLS 1.2 in .Net
framework < 4.6)

FxCop Version 10 Most recent version

You might also like