Is it time to say goodbye to VC6 compiler?

前端 未结 12 867
失恋的感觉
失恋的感觉 2021-02-06 11:32

Of late I\'m facing the issues that points finger to VC6 compiler.

Few of them are:

  1. A function-try-block doesn\'t work. Related Q
  2. in-class constan
12条回答
  •  旧巷少年郎
    2021-02-06 12:06

    No, it was time to say goodbye to it a decade ago. Here are a few reasons why:

    • There are free, standards-compliant compilers available, both from Microsoft and others
    • VC6 was written before the C++ language was standardized, and it is nowhere near standards compliant. Especially templates and the standard library live in a world of their own, with no tie to how these features actually work in ISO C++. The language it compiles is not C++. It is a hybrid of pre-standard C++, Microsoft extensions, compiler limitations and bugs. Neither of which are desirable.
    • VC6 is known to generate invalid code in some cases. Not only does it compile a home-made, buggy and nonstandard language, it also makes invalid optimizations causing crashes, or in some cases actually produces bad assembly that simply can not be executed.

    It is broken, and it was always broken. It was designed to compile a language that ceased existing about the same time as the compiler was relased (when the language was standardized), and it failed even at that task, with countless bugs, some of which have been fixed in the half-dozen service packs that were released. But not all of them, and not even all the critical ones.

    Of course, the downside to this is that your application is most likely just as broken. (not because you're bad programmers, but because it targets a broken compiler. It has to be broken to be accepted by VC6)

    Porting that to a standards-compliant compiler is likely to be a lot of work. Don't assume that you can just import your old projects, click "build", and it'll work.

    So if you're part of a big business that can't just take a month off to switch compilers, you might have to port it as a side project, while part of the team is maintaining the VC6 version. Don't scrap VC6 until you've successfully ported everything, and it works.

提交回复
热议问题