digitalmars.com                        
Last update Sun Mar 4 11:58:08 2018

Switching to Digital Mars C++

Digital Mars C++ offers numerous advantages over other compilers, both in programmer productivity and in the speed and robustness of generated code. Switching to Digital Mars C++ is well worth the effort. This chapter outlines general considerations for converting existing code.

What's in This Chapter

Portable Programming Practices

Some of the programming practices that help make code portable and reusable also help make it compatible with Digital Mars C++. Your code will be easier to convert if you:

Object Level Compatibility

Digital Mars C++ object modules are "broadly compatible" with Microsoft and Borland objects. However, there are some differences:

Using Third-Party Libraries

If you must use third-party libraries written for Microsoft or Borland C++ with the Digital Mars C++ compiler, there is no simple way to determine which features are compatible. Your code could even link correctly and still contain obscure errors.

If you have the source to the third-party library, try recompiling it with Digital Mars C++. A better solution is to obtain the Digital Mars version of the library from the vendor. Recompiling for Digital Mars C++ In many cases, converting programs written for another compiler to Digital Mars C++ can be as easy as recompiling them. Here are some steps you can take to ease recompilation:

Compile time warnings

By default, the Digital Mars C++ compiler generates warnings in response to more conditions than do most other compilers. If you find these unfamiliar warnings annoying, compile with the -w (warning level) option. Each instance of -w on the SC command line turns off a specific warning. For example, the command:
dmc -w2 -w6 myfile.cpp
turns off warnings number 2 and 6. For information on warnings and their numbers, see Compiling Code.
Home | Runtime Library | IDDE Reference | STL | Search | Download | Forums