Microsoft KB Archive/117680

{|
 * width="100%"|

Documentation Clarification for MOVE Overlays

 * }

Q117680

-

The information in this article applies to:


 * Microsoft C/C++ for MS-DOS, version 7.0
 * Microsoft Visual C++, versions 1.0, 1.5

-

SUMMARY
The documentation in the Visual C++ "Command-Line Utilities User's Guide" (both in hard copy and Books Online) and the C/C++ version 7.0 "Environment and Tools" contains potentially misleading information about segment-level overlays and function-level overlays.

MORE INFORMATION
The following paragraph is from page 145 of "Command-Line Utilities User's Guide" (and page 599 of "Environment and Tools"):

ANONYMOUS ALLOCATION
A function not explicitly allocated to a segment is sometimes referred to as an anonymous function. In programs compiled in medium and large models, anonymous functions are allocated to a segment that has a name in the form :

     objfile_TEXT where objfile is the name of the object file containing the functions.

In the medium- and large-memory models, the default naming convention used by the compiler for each segment is OBJFILE_TEXT. When an object file is created, the compiler puts OBJFILE_TEXT in the object file, which is used by the linker to create an MS-DOS overlay program.

NOTE: OBJFILE is in uppercase, because the linker is case sensitive. Also note that the /Gy compiler option is incompatible with ANONYMOUS ALLOCATION.

On page 147 of "Command-Line Utilities User's Guide" (and page 601 of "Environment and Tools"), there is a paragraph discussing function level overlays :

THE FUNCTIONS AND SEGMENTS STATEMENTS
To place individual functions into an overlay, use the FUNCTIONS statement specified with an overlay number. The functions must be compiled as packaged functions. The following statement places three functions into the second overlay :

     FUNCTIONS:2 myfunc1 myfunc2 myfunc3 The function names "myfunc1", "myfunc2", and "myfunc3" conform to the calling and naming conventions specified in the source code. For example, the name of each __cdecl function has an underscore prepended to it and its case is preserved. By default, each function in a C program is declared with __cdecl. The name of each __fortran or __pascal function is converted to uppercase letters. For a C++ program, the function names used in the .DEF file should be the fully decorated names.