INF: C 7.0 Documentation Errata (ERRATA1.TXT, Part 5)

ID Number: Q83638

7.00 | 7.00

MS-DOS | WINDOWS

docerr

Summary:

The following information on known errors and omissions in the

documentation provided with version 7.0 of Microsoft C/C++ was taken

from the documentation errata for Microsoft C/C++ version 7.0.

More Information:

Microsoft updates its languages documentation at the time of

reprinting; therefore, some of the information in this file may

already be included in your manuals.

Part 5: Notes on "Programming Techniques"

Page Note

---- ----

6 Controlling Optimizations from PWB

----------------------------------

The second sentence on the page should read: "From that

dialog box, you can specify the options for either a debug

or release compile."

19 Performing Loop Optimizations (/Ol)

-----------------------------------

In the last sentence on the page, the words "the g option"

should be "the l option."

25 Optimizing for Maximum Efficiency (/Ox)

---------------------------------------

In the list of options implied by /Ox, the entry "Perform

maximum inlining (/Ob2)" should be removed. The /Ox option

selects the default level of inlining (/Ob1) for an optimized

program.

For the fastest program possible, use the following

options:

/Ozaxb2 /Gr

For the smallest program possible, use the following

options:

/Oase /Gs

Note that you can use /Oa only if your code contains no

aliasing. If your code contains aliasing, use the following

options:

/Ose /Gs

35 Precompiled Header Filename Option (/Fp)

----------------------------------------

In the first example, "/FpDPROG" should be "/FpDPROG.PCH".

In the second example, "/FpRPROG" should be

"/FpRPROG.PCH". The /Fp option does not assume the .PCH

extension for the name of the precompiled header file;

you must specify it explicitly.

60 The Tiny Memory Model

---------------------

Add the following paragraph to the end of the section:

"If you are programming in C++, you cannot construct static

objects under the tiny model. Since the predefined stream

objects (like cin and cout) are static objects, you cannot

use iostreams in a tiny-model program."

86 Data Stored in a Named Segment

------------------------------

You cannot store data in the _STACK segment. Of the four

predefined segments, you can store data in only the _CODE,

_DATA, and _CONST segments.

95 Techniques for Using Virtual Memory

-----------------------------------

In the first paragraph following the example, the words

"the search function" should be "the find function."

122 The example of an __asm block in "Calling C Functions" fails

to clean up the stack. The following line needs to be added

at the end of the __asm block after the printf statement:

add sp,6

This removes the parameters that were passed on the stack.

153 QuickWin vs. Windows Applications

---------------------------------

Add the following entry to the list of QuickWin's

limitations:

- Use the stdprn or stdaux streams.

175 Limitations of VESA Support

---------------------------

Change the third item in the list to the following:

"Super VGA BIOS functions 2, 3, 6, 7, and 9 must be

supported. See section 6 of the VESA Super VGA Standard

for more information."

Change the fourth item in the list to the following:

"Three types of hardware windows are supported: single

window systems with a readable/writable 64K window

beginning at A000h, dual overlapping 64K windows beginning

at A000h, and dual adjacent 32K readable/writable windows

beginning at A000h and A800h. See section 5.2.1 of the

VESA Super VGA Standard for more information."

248 Calling a Pascal Function from C

--------------------------------

In the example at the top of the page, the definition for

the Pascal function Fact should be replaced with the

following:

FUNCTION Fact (n : INTEGER) : INTEGER;

VAR

temp : INTEGER;

BEGIN

temp := 1;

WHILE n > 0 DO

BEGIN

temp := temp * n;

n := n - 1;

END;

Fact := temp;

END;

277 Byte Order in a Word

--------------------

The implementation of the two macros LOBYTE and HIBYTE

assumes that type unsigned is always twice the size of

type char. Because ANSI does not require this relationship,

these macros are not completely portable.

Additional reference words: 7.00