2

According to MSDN, Microsoft still ships nothrownew.obj with the Visual C++ 10 (Visual Studio 2010) runtime library, so that users can link against it and have sub-standard behavior of "ordinary" (not nothrow flavor) new returning null on allocation failure. This sub-standard behavior dates back to Visual C++ 6 which is now considered extremely old.

Why would it do so? I mean they make each new version of the compiler more and more Standard-compliant. For example, Visual C++ 7 would support "default int", but Visual C++ 9 would not. And the old sub-standard behavior of new can be easily achieved by slightly changing code to use nothrow flavor of new - this is straightforward and very easy.

Why is this option so important that Microsoft still supports it?

2
  • 3
    Because Microsoft has never ever retired anything in its history? :o)
    – deceze
    Nov 29, 2011 at 6:38
  • @deceze: Well, they did retire "default-int".
    – sharptooth
    Nov 29, 2011 at 6:41

2 Answers 2

4

Well, this is sort of an open question, since nobody except someone responsible from Microsoft can say for sure - if at all. So, I'll take a bite:

I'll guess it is for convenience:

  1. Microsoft itself may need it in some of their products and it is just easier having it together with the compiler tools.
  2. Microsoft may know that someone (say a big vendor/app) still needs it and it is just easier (or even necessary if compiler specific) to still provide it.
  3. Microsoft may know/anticipate that it is generally still "widely" used in legacy apps. Big or small.
  4. "It doesn't hurt", well arguably. For example, Microsoft has a long record of maintaining backward compatibility in Windows (see Raymond Chens blog), again, arguably not always for the better.
  5. Documentation, Tests, etc. would need to be altered (or removed, but still).

That is, removing it may be more trouble yet then just keeping it.

At least they need / should provide a deprecated notice a version prior to removing it. I don't know if they did that for VS2010 or any prior version.

1
  • nothrownew.obj was a big deal for Xbox360 development, where you want high performance code, which EH can wreck with (in terms of code generation) on the 360. As far as I'm aware, this is no longer the case for their upcoming next-gen console (Xbox One) due to it being strictly an x64 platform and WinRT based (which also relies on EH)
    – kornman00
    Sep 15, 2013 at 8:54
2

Because I am now (2012) porting a product from Visual C++ 6.0 to Visual Studio 2010 and that helps greatly to bring the development up to speed. We also will not make the Unicode transition for a few years to come. If Microsoft would not provide the compatibility feature I would build it myself.

As a side note we are a major ISV in a specialized field. If we decide to change OS, an entire Industry would probably change to. (Before Windows we used to also build a specialised OS.)

2
  • So? That's not much, especially since you probably need to spend a minute for each new to check whether NULL is actually handled at all.
    – MSalters
    Oct 23, 2012 at 9:56
  • Actually no. It is old code and old code "works" by virtue of being about 20 years in the field. We don't want to change the existing behavior radically. Sure in the long run it should come out, but one step at a time.
    – rioki
    Nov 6, 2012 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.