What version of the compiler does Raymond use?


From the suggestion box, BrianK asks, "What compiler do you and other developers use? Are you using VS2005 yet?"

To be honest, I don't know what compiler I use.

There is a separate part of the team that worries about things like "What compiler should we use?" They deal with nitty-gritty details like "What version of the compiler should we use and what optimizations should we enable?" as well as higher-level planning like "How are we going to organize our source code so that different parts of the project can take advantage of each others' work while still not requiring all members of the Windows team to compile the entire operating system from scratch when they want to test their changes?"

I am not a member of that team, nor am I invited to their meetings, nor would I be interested in attending their meetings. I'm perfectly happy to let them make these decisions. They pick a compiler version and add it to the toolset that gets installed to your computer when you enlist in the Windows project. That way nobody needs to care what version, service pack, and patch number of the compiler they need to obtain. It just comes with the development environment.

As I've noted in an earlier column in TechNet Magazine, the operating systems division will at times call upon the languages division to produce a special not-found-in-nature version of the compiler in order to satisfy a specific need. Windows (at least the 32-bit version) contains a 16-bit emulator and a miniature copy of 16-bit Windows. Since no modern version of Visual Studio targets 16-bit Windows any more, the compilers that the Windows team uses for 16-bit Windows necessarily must come from somewhere else.

Changing the compiler version is a risky operation, because doing so will most likely expose subtle bugs in the code which erroneously relied upon unspecified behavior, such as order of evaluation or the location of memory barriers. Not the sort of thing you want to spring on a project one week before pencils down. Yes, if all the code were written perfectly, then this wouldn't be a problem. But few people write perfect code.

(And just as a favor to you, I dug through the source code history for Windows and requested the 32-bit native compiler that was in use on August 28, 2006. And then I extracted the version strings and compared it to the version strings that came with Visual Studio 8, and they seemed to match. So I guess it's Visual Studio 8. What relationship that has to VS2005 I don't know.)

Comments (18)
  1. update says:

    What compiler do you and other developers use? Are you using VS2008 yet?

  2. dhiren says:

    This brings up a few interesting questions…

    • your post (and a few other articles) indicates that you don’t use Visual Studio… what kind of environment do you develop in? I couldn’t even begin to imagine doing serious C/C++ development in something like notepad… if you don’t use the VS IDE to write your code in (even if you don’t actually compile or debug using it), what do you use instead?

    • would this also imply that you’d have to manually modify the makefiles, etc, by hand?

    • do all developers working on Windows get access to the entire Windows source tree, or just their team’s source? Do you need to build the entire source in order to work on, say, the shell?

  3. Sunil Joshi says:

    VC8 is Visual Studio 2005.

    VC9 is Visual Studio 2008

    VC10 is Visual Studio 2010.

    (VS2003 is VC7.1)

  4. strik says:

    @dhiren:

    At least for the (core) OS ("kernel"), it is reported that MS uses the compiler they bundle into the WDK (formerly known as DDK). (Or, perhaps it is the other way around: The WDK/DDK includes the compiler used for the core OS.) There is a build utility (build.exe) that gets some special files (dirs, sources) in each directory to find out what is to be compiled. For technical reasons, there is also  a special Makefile (one-liner that includes a Makefile from the build environment).

    You can read it up in the WDK documentation, or on some websites (search for build.exe, for example)

    The approach is very simplistic, but works very good. You do not need to handle the Makefiles themselves by hand (although you can add an additional Makefile.inc), but you get much of the flexibility of that approach.

    There is no fancy GUI, you just have to edit the files "somehow". There is, however, the possibility to use it with some version of VS, using the ddkbuild.bat file from OSR or Hollistech.

    Of course, other groups than the core OS team might use different approaches.

  5. chris says:

    Speaking of perfect code…

    You missed a > on a <p> towards the start, causing browsers to swallow up one sentance

    Snippit below.

    Are you using VS2005 yet?” </P> <P To be honest, I don’t know what compiler I use. </P> <P> There is a separate

    [Oops, fixed. Thanks. -Raymond]
  6. Cooney says:

    "- your post (and a few other articles) indicates that you don’t use Visual Studio… what kind of environment do you develop in? I couldn’t even begin to imagine doing serious C/C++ development in something like notepad… if you don’t use the VS IDE to write your code in (even if you don’t actually compile or debug using it), what do you use instead?"

    Just because vstudio doesn’t build the product doesn’t mean you can’t use it for dev and debugging.

  7. Yuhong Bao says:

    Sunil Joshi: Thank you. I am amazed Raymond don’t even know this.

    [Why should I care about Visual Studio internal version numbers? -Raymond]
  8. blah says:

    This is so sad. MS’s own eagerness to use VS splains why 2010 is such a one-wheeled clunker.

  9. Dave says:

    What’s really nasty is when the public MSDN docs document what the MS-internal version of the compiler does rather than what the publicly-available one does.  PREfast and PREfast for Drivers (PFD) are particularly problematic in this regard.

  10. ulric says:

    No one in Windows probably "needs" anything newer than Visual 2003.  When you have code that is C and some basic C++, you were all set 10 years ago . Probably as fine with VC++ 6, but then you need 64-bit and there were a couple of tweaks to the language.  Newer STL, Rtti, more specific template stuff, … this is probably not used in anything.

    Our own multi-milion lines of code app probably can still compile under VC++ 6, if it wasn’t for a few changes we’ve had to make for the 64-bit port and the scope of variables in for() loops.

    I’m guessing people in the Windows group can use any IDE/editor they’re personally comfortable with, and the build is probably done with makefiles anyway.  Raymond may be using an obsolete version of Brief, CodeWright, or Emacs to edit, and WinDbg to debug..  whatever he was using 10 years ago.  I think most people’s taste and tools settle in your late 20s.

  11. porter says:

    VC++6 wins because you can use shared library CRT and not have to mess around with redist packages! Yes, you have to patch the OS for MS own compiler!

  12. Butch says:

    "Why should I care about Visual Studio internal version numbers? -Raymond"

    Well if a customer sends in a bug report with a code sample asking you to compile it on VC9 (and say the code used TR1, making it incompatible with VC8), it would benefit you to know what they meant. Unless you don’t ever have to do that…

    I’m curious if the Windows team ever updates compilers mid-project or after a product has shipped.

    For projects with long development + support cycles like Windows, it would be really sad if one were stuck with something like VC6 till 2014 (or whenever the extended support ends)

  13. danielye says:

    I guess they use multiple compiler & IDE on the same machine (my machine used to have 6 2003 & 2005 not long ago).

  14. anonymous says:

    If Windows team doesn’t use STL, Boost and other advanced template stuff, I agree that VC6 could be just fine.

    However, I wonder if VC6’s optimizer is as smart and good as the optimizer in VC7 or VC8 or VC9.

    BTW: considering this blog post:

    http://blogs.msdn.com/windowssdk/archive/2009/05/22/windows-7-sdk-with-visual-c-2005-failure-to-compile-in-debug-mode.aspx

    I think that they may have used VS2008 (VC9) to compile Windows 7.

  15. VC6 should no longer be good enough for anyone.  There are lots of features (on-by-default in many cases) in the newer tools that weren’t available in any form back then, such as /GS, /NXCOMPAT, /SAFESEH, /DYNAMICBASE, etc.

  16. porter says:

    > VC6 should no longer be good enough for anyone.

    Interesting argument, to tell everybody else what their requirements are.

  17. Ben Ryves says:

    porter: You can statically link to the C runtime if writing an installer that includes the redistributable package is too much like hard work.

    The fact that VC++6 predates the C++ standard should be reason enough to avoid it!

  18. Teo says:

    @Raymond: Why should you care about the VC numbers? Because Windows Logo requires you to know this stuff.

    Why anyone should use VC 2008 and not 6 or 2003? Because it generates faster and denser code. With current generation of processors and memory, denser code is usually faster just because of the cache misses/page faults.

Comments are closed.

Skip to main content