INF: Character Parameters May Be Prototyped As Integers

ID Number: Q51474

5.10 6.00 6.00a 6.00ax 7.00 | 5.10 6.00 6.00a

MS-DOS | OS/2

Summary:

In Microsoft C versions 5.1, 6.0, 6.0a, 6.0ax, and C/C++ version 7.0,

there are some functions in the run-time library that take character

values as parameters (for example, memccpy, memset, and so on) and

that are prototyped as taking integers. This is not a documentation

error and your program will work correctly if a character value is

passed in the place of the integer parameter (automatic casting takes

care of this).

The integer value is specified because when the compiler pushes

parameters on the stack so that the function being called can use

them, it always pushes them in word increments. In other words,

regardless of whether the value is an integer or a character, 2 bytes

will be pushed on the stack. Therefore, to simplify, the function is

prototyped as receiving an integer.

Additional reference words: 5.10 6.00 6.00a 6.00ax 7.00 S_QUICKC