Compiler

The following compiler features are new for Visual C++ 6.0.

__assume Keyword

The __assume keyword is a hint to the optimizer that says that the expression passed as the argument is true until the expression is killed. This keyword can be used in conjunction with assert() during debug builds to ensure that the expression used with __assume is always true. Specifying __assume for an expression enables the compiler to perform additional optimizations, the safety of which could not be determined without this hint from the programmer. For more information, see in the Visual C++ Programmer's Guide.

Better Inlining Control

For better inline control, there are three new keywords: inline, __inline, and __forceinline. The inline and __inline keywords are hints to the compiler to try to inline the function; the optimizer decides whether inlining should be performed based upon optimization switches (optimizing for size vs. speed) and other heuristics. To provide better control over which functions are inlined, the __forceinline keyword is now supported. This keyword tells the compiler to go beyond the current inlining heuristics and to absolutely inline the function(s) to which it is applied, except in cases in which inlining would be impossible. For more information, see in the Visual C++ Programmer's Guide.

Dependencies Now Stored in a Text File

Exported makefiles now put the file dependencies in a separate, editable text file.

Dependency (.dep) File Generation

This feature provides more control over writing dependency information when you . You can set options for this feature in the following places:

  • ExportMakefile(s) dialog box (Project menu, Export Makefile… command), Write dependencies when writing makefiles check box

  • ProjectSettings dialog box (Project menu, Options command), Allow per-configuration dependencies check box

  • Build tab of the Options dialog box (Tools menu, Options command), Always write dependencies when writing makefiles check box

New and Improved Warnings

New compiler warnings have been added to help catch common programming errors.

Placement Form of Operator Delete

The compiler now supports the placement form of operator delete. Consequently, an exception, thrown during the initialization of an object, calls the proper delete function when the placement new is used.

For more information, see or in the Visual C++ Programmer's Guide, or in the C++ Language Reference.

Pragma Warning

You can use #pragma warning (push,n) and #pragma warning (pop) to push the current warning state (enabled or disabled) onto a stack and pop it off again. n represents a level whose state is to be pushed. You can use this feature when writing headers to ensure that a programmer does not compile the header with a warning level higher than you intend.

Run-Time Error Checks

The Visual C++ compiler can embed certain run-time checks in code to detect common errors. The enables these checks. Run-time checks can only be used in debug (/Od) builds. There are new checks for auto-initialization of local variables, function pointer call stack validation, and call stack validation.

Throughput Improvements

Compile-time throughput in projects with large precompiled header files (.pch) is faster. Compiler throughput on debug projects is as much as 30% faster, and on non-debug projects, as much as 15% faster.

Back to What's New Overview