MSVC: The best choice for Windows

March 7th, 2017

The C++ product team here at Microsoft offers a great C++ experience in the Visual Studio IDE, the Visual Studio Code editor, and various other tools and services. That includes the topic of this blog post: the Microsoft Visual C++ compiler and libraries toolset (MSVC).

Our goal for MSVC is to be the best compiler choice on Windows for targeting Windows, regardless of what editor or IDE you choose to use. We aim to deliver on our goal with continuous investments in the following key areas: full C++ conformance, better errors and warnings, runtime performance, reliability, build throughput, and the best security. Let’s look at each one in more detail.

The best C++ conformance

Getting to full conformance with the C++ Standard is our number one priority when it comes to our compiler. We’ve written a dedicated post discussing our road to conformance. Please go read C++ Standards Conformance from Microsoft.

Better errors and warnings

Effective compiler diagnostics are hard. We know that there are many places where our warnings and errors could improve. We’ve started small, by indicating the column number in MSVC diagnostics. But there is more targeted work to come in the area of improved diagnostics: conforming behavior for ternary operator, missing diagnostics for incorrect code, detailed continuation messages for generic error codes, better warning level configurations for system headers, and more. Look for details on this blog in the coming months.

With regards to runtime performance, our optimization framework got a big rewrite with VS 2015 Update 3. MSVC’s new SSA (static single assignment) optimization framework opens up new possibilities for how we can make your code run faster. We’re taking advantage of this new optimization framework in VS 2017 to make your code faster.

Optimization isn’t just about speed: it’s about correctness. We test our compiler, libraries, and optimizer daily by building Windows and Office as well as more than 50 OSS projects. We also have almost a million custom-written regression tests that run with every source change checkin, full-suite testing with several hundred thousand more tests daily, and performance and throughput testing.

There are many tools that try to make your code secure from outside the box: Valgrind and address/thread sanitizers are popular examples. And there are many of these tools on Windows as well, both from Microsoft and other companies. But MSVC features powerful technologies inside the compiler that integrate security with your code. For example, Control Flow Guard, is highly-optimized security feature that combats many memory corruption vulnerabilities. We can’t talk openly our current security research but we’re always working to make your code (and ours!) safe from increasingly sophisticated attackers.

You can even install the C++ Build Tools on your build machines without needing to install the VS IDE. These are the same tools that are installed with VS 2017 but are intended for build machines. There’s usually no need to install an IDE on a build machine because no development happens on the machines. With VS 2017 you can choose to install just the MSVC toolsetin a scriptable, standalone installer.

For libraries, we’ve created a Windows-specific library package manager that lets you quickly and easily install many open source libraries directly from their repos. We started with an initial list of libraries that you suggested in a survey, plus some of the most popular libraries from GitHub. The number of supported libraries that you can install with VCPkg is always growing.

In closing

If you encounter other problems with MSVC in VS 2017 please let us know via the Report a Problem option, either from the installer or the Visual Studio IDE itself. For suggestions, let us know through UserVoice. Thank you!